Binding.pry is ignored by rails 3

I am trying to debug my small application without creating a price due to AssociationTypeMismatch. So I dig up pry, install, watch railscast and Josh screencast and dig into the wiki.

I "cd" the price controller, but it fails. I set <% binding.pry%> to new.html before submitting the code, but Rails says that the "pry" method is unknown. pry is in my updated gemfile and I restarted the server.

I put bind.pry in the create method of my prices_controller.rb, and Rails happily raves through it to throw an error that I already saw, not a pause, etc. I expected.

Looking at the price model, I am not experienced enough to know what I should look for. What do I not notice? thanx, sam

+2
source share
3 answers

It seems that in addition to the pry pearl, I need the pry-rails pearl. Now binding.pry is recognized.

+2
source

I have the same problem. My solution was to add pry-remote to my Gemfile and call binding.remote_pry instead of binding.pry , open a terminal in the current project and execute pry-remote . happy debugging :)

+3
source

Instead of installing pry-rails, you can simply require 'pry' before binding require 'pry'

+1
source

Source: https://habr.com/ru/post/974648/


All Articles