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

The top-level Rakefile requires Bundler awareness. #22

Merged
merged 1 commit into from Mar 13, 2012
Merged

The top-level Rakefile requires Bundler awareness. #22

merged 1 commit into from Mar 13, 2012

Conversation

halostatue
Copy link

When running the bin/rake Bundler binstub, the binstub sets ENV['BUNDLE_GEMFILE'] which is inherited by calls to the rake environments of the Projects. The top level Gemfile only includes Rake and Thor, so it's not surprising that the builds can't continue. MRI 1.9.2 appears to be able to work around this with "export RUBYOPT=rubygems", but that seems inelegant at best.

This change determines if the Rakefile was launched through a bundled rake; if so, it uses Bundler.with_clean_env (and deletes the BUNDLE_GEMFILE for good measure; necessary if you use the binstub, less necessary if you use "bundle exec rake") and instead of running 'rake', it runs 'bin/rake' to force the use of the Project rake binstub, forcing the use of the correct Gemfile and bundler environment.

The non-bundler path works as it always has.

When running the bin/rake Bundler binstub, the binstub sets
ENV['BUNDLE_GEMFILE'] which is inherited by calls to the rake
environments of the Projects. The top level Gemfile only includes Rake
and Thor, so it's not surprising that the builds can't continue. MRI
1.9.2 appears to be able to work around this with "export
RUBYOPT=rubygems", but that seems inelegant at best.

This change determines if the Rakefile was launched through a bundled
rake; if so, it uses Bundler.with_clean_env (and deletes the
BUNDLE_GEMFILE for good measure; necessary if you use the binstub, less
necessary if you use "bundle exec rake") and instead of running 'rake',
it runs 'bin/rake' to force the use of the Project rake binstub, forcing
the use of the correct Gemfile and bundler environment.

The non-bundler path works as it always has.
@halostatue
Copy link
Author

See Issue #21

@vrish88
Copy link

vrish88 commented Mar 6, 2012

👍

justinko added a commit that referenced this pull request Mar 13, 2012
The top-level Rakefile requires Bundler awareness.
@justinko justinko merged commit 3826d17 into rspec:master Mar 13, 2012
@justinko
Copy link
Contributor

Thanks @halostatue

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

3 participants