Pry ls String problem

I was watching the video under bug hunting. So I followed the steps and used the command ls String to show String methods. I got the Interrupt messages which are not present in the video, and I cannot quit the process using Ctrl + D. Why did I get these messages, and what should I do to quit the process? Thank you!

~/Dropbox/AA_prep/mastermind$ pry
[1] pry(main)> ls String
String.methods: try_convert
String#methods:
% chop! gsub rjust swapcase

  •        chr             gsub!      rpartition   swapcase!          
    
  •        clear           hash       rstrip       to_c               
    

+@ codepoints hex rstrip! to_f
-@ concat include? scan to_i
<< count index scrub to_r
<=> crypt insert scrub! to_s
== delete inspect setbyte to_str
=== delete! intern shell_split to_sym
=~ downcase length shellescape tr
[] downcase! lines shellsplit tr!
[]= dump ljust size tr_s
ascii_only? each_byte lstrip slice tr_s!
b each_char lstrip! slice! unicode_normalize
bytes each_codepoint match split unicode_normalize!
bytesize each_line next squeeze unicode_normalized?
byteslice empty? next! squeeze! unpack
capitalize encode oct start_with? upcase
capitalize! encode! ord strip upcase!
casecmp encoding partition strip! upto
center end_with? prepend sub valid_encoding?
chars eql? replace sub!
chomp force_encoding reverse succ
chomp! freeze reverse! succ!
chop getbyte rindex sum
(END)Interrupt:
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/pager.rb:179:in close' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/pager.rb:179:inclose’
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/pager.rb:36:in open' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/pager.rb:24:inpage’
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/commands/ls.rb:90:in process' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/command.rb:606:incall’
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/command.rb:480:in call_with_hooks' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/command.rb:431:inblock in call_safely’
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/command.rb:439:in use_unpatched_symbol' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/command.rb:430:incall_safely’
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/command.rb:372:in process_line' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/command_set.rb:400:inprocess_line’
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/pry_instance.rb:405:in process_command' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/pry_instance.rb:437:inprocess_command_safely’
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/pry_instance.rb:272:in handle_line' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/pry_instance.rb:243:inblock (2 levels) in eval’
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/pry_instance.rb:242:in catch' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/pry_instance.rb:242:inblock in eval’
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/pry_instance.rb:241:in catch' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/pry_instance.rb:241:ineval’
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.String.methods: try_convert
String#methods:
% chop! gsub rjust swapcase

  •        chr             gsub!      rpartition   swapcase!          
    

String.methods: try_convert
String#methods:
% chop! gsub rjust swapcase

  •        chr             gsub!      rpartition   swapcase!          
    

11.3/lib/pry/repl.rb:77:in block in repl' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/repl.rb:67:inloop’
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/repl.rb:67:in repl' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/repl.rb:38:inblock in start’
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/input_lock.rb:61:in __with_ownership' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/input_lock.rb:79:inwith_ownership’
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/repl.rb:38:in start' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/repl.rb:13:instart’
from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/pry_class.rb:192:in start' from: /Users/sheny/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/pry-0.11.3/lib/pry/cli.rb:116:instart’

Hi shyangch,

The command “ls String” (in all caps for clarification purposes ‘LS STRING’), when ran in Pry, should give you a list of all the methods that the String class has in Ruby.
Very useful knowledge. If your terminal window is not big enough to fit the entire list of methods, you should see a colon which seems to be expecting your input. In this case hitting ‘space’ will show you more of the list, and hitting ‘q’ will exit from the list without showing you the rest of it.

Exiting Pry is a different story, while I believe ‘Ctrl + d’ should work, the more common command for quitting a process is ‘Ctrl + c’. Give that a try. If you are still running into issues let me know, and document the issues and the ordering in which you encounter them.

Mashu

Hitting ‘q’ worked. Thanks.