Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

with_original_env/ORIGINAL_ENV gives the bundled environment #2369

Closed
nevir opened this Issue · 2 comments

3 participants

@nevir

Bundler 1.3.1, ubuntu 12 (not sure if this occurs on previous versions)


env | grep -i bundler
echo "source 'https://rubygems.org'" > Gemfile
bundle
# The Gemfile specifies no dependencies
# Resolving dependencies...
# Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.
bundle exec ruby -e 'p Bundler::ORIGINAL_ENV.select { |k,v| k =~ /(bundle|gem)/i }'
# {"GEM_PATH"=>"/usr/local/lib/ruby/gems/1.9.1:/home/ubuntu/.gem/ruby/1.9.1", "GEM_HOME"=>"/usr/local/lib/ruby/gems/1.9.1", "BUNDLE_BIN_PATH"=>"/usr/local/lib/ruby/gems/1.9.1/gems/bundler-1.3.1/bin/bundle", "BUNDLE_GEMFILE"=>"/tmp/bundle/Gemfile", "_ORIGINAL_GEM_PATH"=>"/usr/local/lib/ruby/gems/1.9.1:/home/ubuntu/.gem/ruby/1.9.1"}
@xaviershay
Collaborator

Update so I can copy+paste the repro. Still an issue.

@indirect
Owner

ur doin it wrong :( when you use bundle exec ruby, the "original" environment is the one created by bundle exec. You may be able to forcibly strip the bundled environment from ENV using one of with_clean_env or with_original_env. That said, the "correct" way to do this is:

ruby -rubygems -e 'require "bundler/setup"; p Bundler::ORIGINAL_ENV.select { |k,v| k =~ /(bundle|gem)/i }'
@indirect indirect closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.