You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, just opened pry/pry#1743. I know now that recent Rails versions only mix in reload! and friends to the top-level REPL context, as opposed to mixing them into Object, which means they won't be available inside a binding.pry session in the context of a specific class.
You might be able to make it work by running extend Rails::ConsoleMethods after starting the session (possibly after running require "rails/console/app" and require "rails/console/helpers"). If that doesn't help then feel free to open an issue on pry-rails and we could discuss ways of making this easier.
Running that in my Rails binding.pry session did indeed work. Now I'd like to avoid typing it every time I run pry. To that end, I tried pasting it into my ~/.irbrc file, and into a ~/.pryrc file, but it didn't seem to work.
Any tips for making pry run this automatically for future Rails sessions?
The text was updated successfully, but these errors were encountered:
jm3
changed the title
Invoking pry from within Rails
Mixing reload! into Rails binding.pry sessions
Feb 8, 2018
Maybe try Object.send(:include, Rails::ConsoleMethods) instead of the extend line in your .pryrc? If you wrapped it in an if defined?(Rails) or something then it should be pretty safe.
Hi, just opened pry/pry#1743. I know now that recent Rails versions only mix in
reload!
and friends to the top-level REPL context, as opposed to mixing them intoObject
, which means they won't be available inside abinding.pry
session in the context of a specific class.@rf- said:
Running that in my Rails binding.pry session did indeed work. Now I'd like to avoid typing it every time I run pry. To that end, I tried pasting it into my
~/.irbrc
file, and into a~/.pryrc
file, but it didn't seem to work.Any tips for making pry run this automatically for future Rails sessions?
The text was updated successfully, but these errors were encountered: