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
spring is not part of the bundle for production environment #447
Comments
The simple workaround is to replace:
with:
in the |
yeah that's a bug ... it should ignore when the gem is not installed ... @felixbuenemann to the rescue! |
I'll check it out. |
Yeah, this raises a |
@grosser There are two ways to handle this:
begin
load File.expand_path('../spring', __FILE__)
rescue LoadError => e
raise unless e.message =~ /spring/
end
begin
spring_bin_path = File.expand_path('../spring', __FILE__)
load spring_bin_path
rescue Gem::LoadError => e
raise unless e.name == 'spring'
rescue LoadError => e
raise unless e.message.end_with? spring_bin_path, 'spring/binstub'
end The first one is more likely to swallow unrelated errors the second one more likely to miss errors we don't yet know about. Which direction do you want me to go? (I'm leaning towards one.) |
first one sounds simplest+safest to me ... On Wed, Nov 18, 2015 at 8:58 AM, Felix Bünemann notifications@github.com
|
I've yet to be able to reproduce this in the acceptance tests, I'll try setting up a test app on heroku. In the acceptance test I either get the LoadError for 'spring/binstub' (Gemfile.lock lists spring) or no error if I remove spring from the Gemfile.lock. @dmilisic Do you check Gemfile.lock into git and could you post a gist of your Gemfile and Gemfile.lock? |
Fails on Heroku for me with the error below and I think it is the same issue. When I replaced the
|
Thanks, I can reproduce it with the getting started example app on heroku. |
@grosser I think the reason I can't reproduce the |
PR without test then ? On Wed, Nov 18, 2015 at 2:15 PM, Felix Bünemann notifications@github.com
|
Yeah, I'll do that. |
The previous binstub code did not catch Gem::LoadErrors which can be generated by bundler or rubygems trying to load the spring gem. This fixes rails#447.
@dmilisic @ashwinputhige Should be fixed, please upgrade to spring 1.4.4 and don't forget to run |
It seems that new binstub format (introduced with #444) is causing the issue in the production envrionment when the bundle is installed without development and test:
Full setup:
rails 2.4.5 application
ruby 2.2.3
spring 1.4.3
heroku cedar-14 stack
bundle is installed using
bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
The issue occurs when running
heroku run rake db:migrate
The text was updated successfully, but these errors were encountered: