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
Rails includesRails::ConsoleMethods into the console::ExtendCommandBundle module, in this case that'd be Pry::ExtendCommandBundle which is an empty module so nothing is happening.
I could get this working by doing TOPLEVEL_BINDING.eval('self').extend ConsoleFoo but that seems a lot like a hack, is there a way we could have ExtendCommandBundle work?
The console block gets called before console.start (Pry.start) so maybe there's something to be done there?
Thanks
The text was updated successfully, but these errors were encountered:
Just ran into this as well. Can confirm that switching back to IRB mitigates the problem.
When you run include Rails::ConsoleMethods in the console, the methods are available again.
rails c
Loading development environment (Rails 4.1.6)
[1] pry(main)> foo
=> :foo
[2] pry(main)> bar
NameError: undefined local variable or method `bar' for main:Object
from (pry):2:in `__pry__'
Hi,
I'm trying to add default methods to the console like this:
Rails includes
Rails::ConsoleMethods
into theconsole::ExtendCommandBundle
module, in this case that'd bePry::ExtendCommandBundle
which is an empty module so nothing is happening.I could get this working by doing
TOPLEVEL_BINDING.eval('self').extend ConsoleFoo
but that seems a lot like a hack, is there a way we could haveExtendCommandBundle
work?The
console
block gets called beforeconsole.start
(Pry.start
) so maybe there's something to be done there?Thanks
The text was updated successfully, but these errors were encountered: