I've set pry to load in place of irb when I enter rails console. I cannot find the page or remember how to bring it back to the default behavior as it seems to be interfering with my Rubymine debugger. Any suggestions?
To invoke the debugger, place binding. pry somewhere in your code. When the Ruby interpreter hits that code, execution stops, and you can type in commands to debug the state of the program.
But how do you know what line you should place a binding. pry ? Well that depends on what you want to find out. But, a good rule of thumb would be to place it after the section of code that is taking in, or manipulating the piece of data that you're curious about.
I just found the issue, pry-rails gem. Forgot that its purpose is to make 'rails console' to open pry instead.
You may have modified your ~/.irbrc
to start pry when IRB is loaded. Check there first.
Rails hooks into the application by loading your environment. To load your rails application into a pry session try this: pry -I . -r config/environment
Do you mean this page?
http://www.dotnetguy.co.uk/post/2011/08/23/replace-the-rails-console-with-pry
The page (now dead) contained this code, which could be what is keeping Pry running instead of IRB:
MyApp::Application.configure do
silence_warnings do
begin
require 'pry'
IRB = Pry
rescue LoadError
end
end
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With