banister / pry-doc

Provide MRI Core documentation and source code for the Pry REPL
https://github.com/banister/pry-doc
Other
9 stars 0 forks source link

The order of `pry-rails` and `pry-doc` matters in Gemfile #3

Open bluemont opened 11 years ago

bluemont commented 11 years ago

This order works:

group :development do
  gem 'pry-rails', '~> 0.2'
  gem 'pry-doc', '~> 0.4'
end

This order does not:

  gem 'pry-doc', '~> 0.4'
  gem 'pry-rails', '~> 0.2'

It fails with this stacktrace:

/Users/david/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/pry-doc-0.4.5/lib/pry-doc.rb:22:in `<class:Pry>': undefined method `config' for Pry:Class (NoMethodError)
    from /Users/david/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/pry-doc-0.4.5/lib/pry-doc.rb:18:in `<top (required)>'
    from /Users/david/.rbenv/versions/1.9.3-p374/lib/ruby/gems/1.9.1/gems/bundler-1.3.5/lib/bundler/runtime.rb:72:in `require'

The ordering of bundler items should not matter, right?

tmaier commented 10 years ago

I have the same issue when I put them into the :development, :test group.

But when I put them into the :development group only, the order is not of any matter

janko commented 10 years ago

The thing is that pry has to require pry-doc (not vice versa), so Pry has to be required first (which happens when it's first in the Gemfile).