Sometimes I have reason to want to start the rails console as an irb repl rather than pry (as awesome as pry is). It will default to pry because pry has in the Gemfile. Hows is that done nowadays?
I think there used to be a --irb option when running rails console
but that seems to be gone now. I get a deprecation error message when I try it.
More details
If I just run "rails console" it takes me to pry.
If I run "rails console -irb=irb":
$ rails c -irb=irb
--irb option is no longer supported. Invoke `/your/choice/of/ruby script/rails console` instead
Relevent lines from my Gemfile:
gem 'rails', '3.2.18'
gem 'pry-rails'
gem 'pry-plus'
To exit everything, use: exit! This should ignore all proceeding bindings. This also kills the server at the same time.
Calling binding. pry is essentially 'prying' into the current binding or context of the code, from outside your file. So when you place the line binding. pry in your code, that line will get interpreted at runtime (as your program is executed).
Starting a Rails console session To exit the console, type: quit .
Launching pry when calling rails console
or rails c
is set up by the pry-rails gem. If you look in the pry-rails issues there is one that describes a solution.
Define the environment variable DISABLE_PRY_RAILS
as 1
.
So you can call rails console without pry with:
DISABLE_PRY_RAILS=1 rails c
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