Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kernel#y missing from 'rails console' when run via spring #14587

matthewd opened this issue Apr 3, 2014 · 0 comments · Fixed by #14588


Copy link

commented Apr 3, 2014

% rails c
Loading development environment (Rails 4.1.0.rc2)
irb(main):001:0> y nil
=> nil

% spring rails c
Loading development environment (Rails 4.1.0.rc2)
irb(main):001:0> y nil
NoMethodError: undefined method `y' for main:Object

This is a similar symptom to #7207, but since that predates spring, the similarity seems superficial.

Basically, this is because Kernel#y only gets defined if IRB is loaded before YAML. And spring (by design) pre-boots the application before it decides which sub-command will be executed.

@matthewd matthewd added this to the 4.1.0 milestone Apr 3, 2014

matthewd added a commit to matthewd/rails that referenced this issue Apr 3, 2014
Explicitly load Kernel#y when starting a console
Previously, we relied on the IRB-detection in Psych itself. But that
doesn't work when we're running under spring: the application boots (and
thus psych is required) before we switch to console mode and load IRB.

Fixes rails#14587.

@matthewd matthewd closed this Apr 3, 2014

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.