Guest User

Untitled

a guest
Jan 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.04 KB | None | 0 0
  1. The script, stripped to its bare essentials, is basically a stand-in for the 'pry' executable:
  2.  
  3. $ cat mypry
  4. #!/usr/bin/env ruby
  5. require 'rubygems'
  6. require 'pry'
  7. binding.pry
  8.  
  9. When run directly, it works beautifully.
  10.  
  11. $ ruby ./mypry
  12. From: ./mypry @ line 4 in Object#N/A:
  13.  
  14. 1: #!/usr/bin/env ruby
  15. 2: require 'rubygems'
  16. 3: require 'pry'
  17. => 4: binding.pry
  18. 5:
  19. pry(main)>
  20.  
  21. When run via load() after rubygems, boom:
  22. $ ruby -rubygems -e 'load("./mypry")'
  23. /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry/default_commands/context.rb:148:in `to_s': NULL pointer given (ArgumentError)
  24. from /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry/default_commands/context.rb:148
  25. from /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry/command_set.rb:17:in `instance_exec'
  26. from /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry/command_set.rb:17:in `call'
  27. from /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry/command_set.rb:194:in `run_command'
  28. from /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry/command_processor.rb:166:in `execute_command'
  29. from /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry/command_processor.rb:139:in `process_commands'
  30. from /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry/pry_instance.rb:301:in `process_line'
  31. from /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry.rb:15
  32. from /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry/pry_instance.rb:109:in `call'
  33. from /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry/pry_instance.rb:109:in `exec_hook'
  34. from /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry/pry_instance.rb:140:in `repl_prologue'
  35. from /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry/pry_instance.rb:173:in `repl'
  36. from /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry/pry_class.rb:95:in `start'
  37. from /usr/lib/ruby/gems/1.8/gems/pry-0.9.5/lib/pry/core_extensions.rb:20:in `pry'
  38. from ./mypry:4
  39. from -e:1:in `load'
  40. from -e:1
Add Comment
Please, Sign In to add comment