Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

undefined method file=' for #<Pry::History using pry v0.13 #956

Closed
johnpaulashenfelter opened this issue Mar 22, 2020 · 2 comments
Closed

Comments

@johnpaulashenfelter
Copy link

johnpaulashenfelter commented Mar 22, 2020

Using the latest version of guard and pry (just released) in a Rails application, you'll get this error:

$ bundle exec guard

18:56:59 - INFO - Bye bye...
/Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/guard-2.16.1/lib/guard/jobs/pry_wrapper.rb:131:in `_setup': undefined method `file=' for #<Pry::History:0x00007fd6b59ed778> (NoMethodError)
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/guard-2.16.1/lib/guard/jobs/pry_wrapper.rb:68:in `initialize'
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/guard-2.16.1/lib/guard/interactor.rb:17:in `new'
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/guard-2.16.1/lib/guard/interactor.rb:17:in `initialize'
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/guard-2.16.1/lib/guard.rb:67:in `new'
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/guard-2.16.1/lib/guard.rb:67:in `setup'
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/guard-2.16.1/lib/guard/commander.rb:32:in `start'
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/guard-2.16.1/lib/guard/cli/environments/valid.rb:16:in `start_guard'
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/guard-2.16.1/lib/guard/cli.rb:122:in `start'
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/thor-0.20.3/lib/thor/base.rb:466:in `start'
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/guard-2.16.1/lib/guard/aruba_adapter.rb:32:in `execute'
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/guard-2.16.1/lib/guard/aruba_adapter.rb:19:in `execute!'
	from /Users/johnpaul/me/gobbol/.bundle/ruby/2.6.0/gems/guard-2.16.1/bin/_guard-core:11:in `<main>'

There's a PR that fixes this already submitted #955

In the meantime, you can lock your version of pry to v0.12 in your Gemfile

  gem 'pry', '< 0.13' # or maybe just '0.12.2'

These versions work:

 * guard (2.16.1)
 * pry (0.12.2)
 * pry-byebug (3.8.0)
 * pry-rails (0.3.9)

while this set will now

 * guard (2.16.1)
 * pry (0.13)
 * pry-byebug (3.9.0)
 * pry-rails (0.3.9)
@johnpaulashenfelter
Copy link
Author

A more complete diff of the Gemfile.lock

-    method_source (0.9.2)
+    method_source (1.0.0)
     mimemagic (0.3.4)
     mini_mime (1.0.2)
     mini_portile2 (2.4.0)
@@ -165,12 +165,12 @@ GEM
     parser (2.7.0.5)
       ast (~> 2.4.0)
     pg (1.2.3)
-    pry (0.12.2)
-      coderay (~> 1.1.0)
-      method_source (~> 0.9.0)
-    pry-byebug (3.8.0)
+    pry (0.13.0)
+      coderay (~> 1.1)
+      method_source (~> 1.0)
+    pry-byebug (3.9.0)
       byebug (~> 11.0)
-      pry (~> 0.10)
+      pry (~> 0.13.0)

@rymai
Copy link
Member

rymai commented Mar 23, 2020

I think this is a duplicate of #953. Thanks for the issue anyway!

@rymai rymai closed this as completed Mar 23, 2020
johnpaulashenfelter added a commit to department-of-veterans-affairs/vets-api that referenced this issue Apr 3, 2020
The `pry` gem v0.13 breaks guard less than 2.16.2 (guard/guard#956).
johnpaulashenfelter added a commit to department-of-veterans-affairs/vets-api that referenced this issue Apr 3, 2020
* Update pry-byebug and pry gems
* Update guard gem

The `pry` gem v0.13 breaks guard less than 2.16.2 (guard/guard#956).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants