This repository has been archived by the owner on Apr 14, 2021. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2k
brittle handling of ENV['BUNDLE_GEMFILE'] #3678
Labels
Comments
You're right, and this is a bug. We should fix it. The reason no one else has had this problem, though, is that Bundler provides a way to run commands outside of the current bundle:
I'd suggest that as a workaround for now. |
Ideally, I'd be able to do: In my case, I have my hands tied on "both sides" (root and user), because I can't call Ruby code from root context (I don't have access, though process is run through |
postmodern
added a commit
to rubysec/bundler-audit
that referenced
this issue
May 27, 2015
That sounds good to me. |
Cool, will wrap up a PR with some tests soon. |
Cool, thanks! |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Setting
BUNDLE_GEMFILE=
(as opposed to unsetting the env variable) causes Bundler to go crazy.The problem is with these 2 lines here: https://github.com/bundler/bundler/blob/e8c962ef2a3215cdc6fd411b6724f091a16793d6/lib/bundler/cli.rb#L19-L20
When
BUNDLE_GEMFILE
happens to be""
:custom_gemfile
becomes "", which evaluates totrue
File.expand_path(custom_gemfile)
expands to the current directory and ...ENV['BUNDLE_GEMFILE']
now contains a directory instead of a file - which causes Bundler to blow up.Use case: I'm running
bundle install
as root on oneGemfile
, and then running another, unrelatedbundle install
on anotherGemfile
- the variable is set and propagated and deleting the env variable is tricky on my setup (my workaround is:/usr/bin/env -u BUNDLE_GEMFILE foo
, which isn't portable).The text was updated successfully, but these errors were encountered: