Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

pry-coolline with pry 0.13.1 gives undefined method `file' for #<Pry::History:...> #36

Closed
owst opened this issue Apr 20, 2020 · 3 comments

Comments

@owst
Copy link
Contributor

owst commented Apr 20, 2020

Attempting to use pry-coolline with pry 0.13.1 gives: undefined method 'file' for #<Pry::History:0x00007fc0d148a578> (NoMethodError)

Reproduction

Save the following in foo.rb:

require 'bundler/inline'

gemfile do
  source 'https://rubygems.org'
  gem 'pry', '= 0.13.1'
  gem 'pry-coolline' 
end

binding.pry

p 42

Running ruby foo.rb gives:

$ ruby /tmp/foo.rb
Traceback (most recent call last):
	13: from /tmp/foo.rb:3:in `<main>'
	12: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0/bundler/inline.rb:70:in `gemfile'
	11: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `require'
	10: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:65:in `each'
	 9: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `block in require'
	 8: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:76:in `each'
	 7: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:81:in `block (2 levels) in require'
	 6: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:81:in `require'
	 5: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/pry-coolline-0.2.5/lib/pry-coolline.rb:18:in `<top (required)>'
	 4: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/pry-coolline-0.2.5/lib/pry-coolline/wrapper.rb:55:in `make_input'
	 3: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/pry-coolline-0.2.5/lib/pry-coolline/wrapper.rb:26:in `make_coolline'
	 2: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/pry-coolline-0.2.5/lib/pry-coolline/wrapper.rb:26:in `new'
	 1: from /Users/owen/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/coolline-0.5.0/lib/coolline/coolline.rb:138:in `initialize'
/Users/owen/.rbenv/versions/2.5.5/lib/ruby/gems/2.5.0/gems/pry-coolline-0.2.5/lib/pry-coolline/wrapper.rb:35:in `block in make_coolline': undefined method `file' for #<Pry::History:0x00007ff490122528> (NoMethodError)
Did you mean?  filter
@SamZapata
Copy link

I think I have the same issue. Well, I'm trying to use the gem 'spirit_hands', the installation is ok, but when I run 'rails console' this happens...
../.rbenv/versions/2.6.5/lib/ruby/gems/2.6.0/gems/pry-coolline-0.2.5/lib/pry-coolline/wrapper.rb:35:in block in make_coolline': undefined method file' for #<Pry::History:0x00007f59bc6dbc40> Did you mean? filter (NoMethodError)
And I still don't understand why

@rusterholz
Copy link

I'm seeing the same issue in an unrelated project. Do we know why this breaking change is not mentioned in the pry changelog?

@gato-omega
Copy link

I find @owst fix to be the correct approach since there's no way around the API change for the file history in the config (while keeping it backwards compatible).

@SamZapata I used his fork on Gemfile before any gems that might require it (such as spirit_hands):

gem 'pry-coolline', github: 'owst/pry-coolline', branch: 'support_new_pry_config_api'

Thanks @owst ! 😄

@liaden liaden closed this as completed in 030aa95 Jan 7, 2021
liaden added a commit that referenced this issue Jan 7, 2021
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants