Pry: Undefined local variable or method `_pry_' for Pry::Helpers::BaseHelpers:Module

Created on 10 Oct 2017  路  4Comments  路  Source: pry/pry

Good evening,

I'm relatively new programming in RoR I did a bundle update and then I started rails c, once inside the console I typed Mymodel.all and boom this error!!!!

(pry) output error: #_pry_' for Pry::Helpers::BaseHelpers:Module Did you mean? pry> /home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/helpers/base_helpers.rb:101:instagger_output'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/debbie-2.0.0/lib/debbie/railtie.rb:19:in block (3 levels) in <class:Railtie>' /home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/pry_instance.rb:367:inshow_result'

Then I started reading the issues and I found in this one #1657 maybe there is the mistake but the fact is that well I do not know how to fix it, in fact I'm not sure is that is a bug is in another part of the gem. I will leave the whole log at the end.

Thanks!!!!!!!!

(pry) output error: #_pry_' for Pry::Helpers::BaseHelpers:Module Did you mean? pry> /home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/helpers/base_helpers.rb:101:instagger_output'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/debbie-2.0.0/lib/debbie/railtie.rb:19:in block (3 levels) in <class:Railtie>' /home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/pry_instance.rb:367:inshow_result'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/pry_instance.rb:336:in block in handle_line' /home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/pry_class.rb:395:incritical_section'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/pry_instance.rb:335:in handle_line' /home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/pry_instance.rb:243:inblock (2 levels) in eval'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/pry_instance.rb:242:in catch' /home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/pry_instance.rb:242:inblock in eval'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/pry_instance.rb:241:in catch' /home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/pry_instance.rb:241:ineval'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/repl.rb:77:in block in repl' /home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/repl.rb:67:inloop'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/repl.rb:67:in repl' /home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/repl.rb:38:inblock in start'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/input_lock.rb:61:in __with_ownership' /home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/input_lock.rb:79:inwith_ownership'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/repl.rb:38:in start' /home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/repl.rb:13:instart'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-0.11.1/lib/pry/pry_class.rb:192:in start' /home/efranco/.rvm/gems/ruby-2.4.0/gems/pry-byebug-3.5.0/lib/pry-byebug/pry_ext.rb:11:instart_with_pry_byebug'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/railties-5.0.6/lib/rails/commands/console.rb:65:in start' /home/efranco/.rvm/gems/ruby-2.4.0/gems/railties-5.0.6/lib/rails/commands/console_helper.rb:9:instart'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/railties-5.0.6/lib/rails/commands/commands_tasks.rb:78:in console' /home/efranco/.rvm/gems/ruby-2.4.0/gems/railties-5.0.6/lib/rails/commands/commands_tasks.rb:49:inrun_command!'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/railties-5.0.6/lib/rails/commands.rb:18:in <top (required)>' /home/efranco/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:inrequire'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in block in require' /home/efranco/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:259:inload_dependency'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:293:in require' /home/efranco/Projects/diego/bin/rails:26:in /home/efranco/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:287:in load' /home/efranco/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:287:inblock in load'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:259:in load_dependency' /home/efranco/.rvm/gems/ruby-2.4.0/gems/activesupport-5.0.6/lib/active_support/dependencies.rb:287:inload'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/commands/rails.rb:6:in call' /home/efranco/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/command_wrapper.rb:38:incall'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:201:in block in serve' /home/efranco/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:171:infork'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:171:in serve' /home/efranco/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:141:inblock in run'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in loop' /home/efranco/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:inrun'
/home/efranco/.rvm/gems/ruby-2.4.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in <top (required)>' /home/efranco/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:inrequire'
/home/efranco/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in require' -e:1:in

'

bug good first issue

All 4 comments

Good evening.
I think the bug is here: https://github.com/pry/pry/blob/master/lib/pry/helpers/base_helpers.rb#L101
That line should be if defined?(_pry_) and _pry_ (or similar).
Would you like to open a pull request to fix it?
stagger_output is due to be deprecated: https://github.com/pry/pry/pull/1638 - just for your information. Still a bug.

This should be fixed on master branch, thanks to @robsliwi

just released the fix for this on 0.11.2 lemme knwo if it works for you guys @robsliwi @efranco89

@banister Can confirm, fixed on 0.11.2 :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jjgh picture jjgh  路  6Comments

drmohundro picture drmohundro  路  4Comments

benoittgt picture benoittgt  路  4Comments

vaidehijoshi picture vaidehijoshi  路  3Comments

avit picture avit  路  5Comments