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

setup Bundler in engines bin/rails stub. #13696

Merged
merged 1 commit into from Jan 21, 2014

Conversation

senny
Copy link
Member

@senny senny commented Jan 13, 2014

This is necessary when bundling gems locally using BUNDLE_PATH.
Without this patch bin/rails fails with:

/Users/senny/.rbenv/versions/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rails/all (LoadError)
    from /Users/senny/.rbenv/versions/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from bin/rails:7:in `<main>'

I wasn't sure what's the best way to test this, without effectively calling bundle and using a BUNDLE_PATH, which would take some time.

This is necessary when bundling gems locally using `BUNDLE_PATH`.
Without this patch `bin/rails` fails with:

```
/Users/senny/.rbenv/versions/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- rails/all (LoadError)
	from /Users/senny/.rbenv/versions/2.0.0-p353/lib/ruby/site_ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
	from bin/rails:7:in `<main>'
```
@senny
Copy link
Member Author

senny commented Jan 13, 2014

@rafaelfranca
Copy link
Member

I don't know a best way to test it either. I think the current tests are still doing this right?

@senny
Copy link
Member Author

senny commented Jan 13, 2014

@rafaelfranca by doing this you mean call bundle install? If so, yes they do but I didn't check if BUNDLE_PATH is used.

@rafaelfranca
Copy link
Member

Yes, running bundle install. I think BUNDLE_PATH is not being used but we can use, as far we reset the value after the test

@senny
Copy link
Member Author

senny commented Jan 13, 2014

@rafaelfranca so you suggest to create a second slooo running test or modify the existing one to verify both, the current behvaior and also the binstub?

@rafaelfranca
Copy link
Member

If we can verify both in the same test I'd go with this option

@senny
Copy link
Member Author

senny commented Jan 14, 2014

@rafaelfranca I can't even get it working using BUNDLE_PATH. The bundle install call is made in a clean env. Any idea on how to write a reproduction?

@senny
Copy link
Member Author

senny commented Jan 21, 2014

Sadly there is no clean way to verify this behavior in our test suite. I'm going to commit this as-is and backport it to 4-0-stable.

senny added a commit that referenced this pull request Jan 21, 2014
setup Bundler in engines `bin/rails` stub.
@senny senny merged commit c60e062 into rails:master Jan 21, 2014
@senny senny deleted the engine_bin_rails_load_bundler branch January 21, 2014 13:58
senny added a commit that referenced this pull request Jan 21, 2014
setup Bundler in engines `bin/rails` stub.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants