4

I am using pry for rails console.

Whenever I evaluate some value in console, NoMethodError is raised in bindings_equal?, that is a method of pry-stack_explorer gem. The input and output is as follows.

That is not harmful but a nuisance. I want to remove it.

Can anyone help?

> bundle exec rails console

Loading development environment (Rails 4.1.5)

Frame number: 0/21
[1] pry(main)> 
[2] pry(main)> 
[3] pry(main)> 1
when_started hook failed: NoMethodError: private method `eval' called for nil:NilClass
{My Bundle Directory}/ruby/2.1.0/gems/pry-stack_explorer-0.4.9.1/lib/pry-stack_explorer.rb:109:in `bindings_equal?'
(see _pry_.hooks.errors to debug)
=> 1
[4] pry(main)> 

I use these gems relating to pry:

gem 'pry-rails'
gem 'pry-remote'
gem 'pry-byebug'

Thank you.

谷口昂平
  • 268
  • 3
  • 12
  • Seeing this same issue without using awesome print, so the below answers don't really help in my case. Not sure if in your context awesome print is present or not. – Ben Zittlau Jan 18 '15 at 19:03
  • When I had this problem, I was using awesome print and had `~/.pryrc` with `Pry.config.print`. In my case the problem occured by the interference of pry and awesome print. So I can not explain your case. – 谷口昂平 Jan 19 '15 at 06:29

2 Answers2

3

I had to add

require 'awesome_print'
AwesomePrint.pry!

to my ~/.pryrc (per the AwesomePrint docs) to fix this error.

Some are mentioning removing Pry.config.print from their ~/.pryrc but I didn't even have a ~/.pryrc, so it appears this can happen by just using awesome_print and pry together.

Eric Boehs
  • 1,327
  • 13
  • 17
2

I'm not running the same gems as you, but have run across the same error.

I started an issue on the github project

Justin
  • 5,029
  • 1
  • 21
  • 21
  • My problem is caused by the same reason. Removing `Pry.config.print` from my `.pryrc` turns the errors off. Thanks a lot! – 谷口昂平 Sep 12 '14 at 10:35
  • 2
    According to [awesome_print's readme](https://github.com/michaeldv/awesome_print#pry-integration), in order to integrate pry with awesome_print, now we should use `AwesomePrint.pry!` not `Pry.config.print` – 谷口昂平 Sep 12 '14 at 12:45