Skip to content

Commit 666db7d

Browse files
noniqjonleighton
authored andcommitted
Make sure running bin/spring does not add an empty string to Gem.path.
An empty string in `Gem.path` causes issues in third party gems like rvm or better_errors. See #297 and #310. This happens because `Gem.paths=` picks up `$GEM_HOME` even if it’s set to an empty string. Fixed by unsetting `$GEM_HOME`.
1 parent b542b9a commit 666db7d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
## Next version
22

3+
* Make sure running `bin/spring` does not add an empty string to `Gem.path`.
4+
Issues #297, #310.
35
* Fixed problem with `$0` including the command line args, which could
46
confuse commands which try to parse `$0`. This caused the
57
spring-commands-rspec to not work properly in some cases. Issue #369.

lib/spring/client/binstub.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ class Binstub < Command
3838
3939
if match = Bundler.default_lockfile.read.match(/^GEM$.*?^ (?: )*spring \((.*?)\)$.*?^$/m)
4040
ENV["GEM_PATH"] = ([Bundler.bundle_path.to_s] + Gem.path).join(File::PATH_SEPARATOR)
41-
ENV["GEM_HOME"] = ""
41+
ENV["GEM_HOME"] = nil
4242
Gem.paths = ENV
4343
4444
gem "spring", match[1]

0 commit comments

Comments
 (0)