pry / pry-stack_explorer

Walk the stack in a Pry session
Other
454 stars 28 forks source link

uninitialized constant PryStackExplorer::Pry #30

Closed brchristian closed 7 years ago

brchristian commented 7 years ago

If I put pry-stack_explorer in my Gemfile, but not pry itself, then despite the fact that there is a gemspec dependency on pry, I still see errors of the following:

/.gem/ruby/2.4.1/gems/bundler-1.15.1/lib/bundler/runtime.rb:85:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'pry-stack_explorer'. (Bundler::GemRequireError)
Gem Load Error is: uninitialized constant PryStackExplorer::Pry
Backtrace for gem load error is:
/.gem/ruby/2.4.1/gems/pry-stack_explorer-0.4.9.2/lib/pry-stack_explorer/commands.rb:133:in `<module:PryStackExplorer>'
/.gem/ruby/2.4.1/gems/pry-stack_explorer-0.4.9.2/lib/pry-stack_explorer/commands.rb:1:in `<top (required)>'
/.gem/ruby/2.4.1/gems/pry-stack_explorer-0.4.9.2/lib/pry-stack_explorer.rb:5:in `<top (required)>'
/.gem/ruby/2.4.1/gems/bundler-1.15.1/lib/bundler/runtime.rb:82:in `require'

My hunch is that there is something happening with load order, and that pry needs to be loaded sooner than it is by default.

0x1eef commented 7 years ago

just add require 'pry' unless defined?(::Pry) to pry-stack_explorer.rb and send a PR :wink:

brchristian commented 7 years ago

@r-obert Submitted #31 :+1: