Skip to content

Commit 11b8527

Browse files
committed
Fix a problem with gems bundled from a git repository
This occurred when the `bin/spring` was generated before 1.3.0. Upgrading to 1.3.0 then lead to a bundler error. This happened because in 1.3.0 we switched from forking the server process to spawning it as a fresh process. In the fresh process, bundler didn't seem to like GEM_HOME being set to an empty string. We have already separately changed the generated binstub so that GEM_HOME is nil, rather than the empty string (666db7d). Therefore this fix just maps the empty string from older binstubs to a nil value.
1 parent 511c018 commit 11b8527

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Next release
2+
3+
* Fix a problem with gems bundled from a git repository, where the
4+
`bin/spring` was generated before 1.3.0.
5+
16
## 1.3.0
27

38
* Automatically restart spring after new commands are added. This means

lib/spring/client/run.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,10 @@ def run
6464
def boot_server
6565
env.socket_path.unlink if env.socket_path.exist?
6666

67+
# The GEM_HOME handling is to work around a problem with spring binstubs
68+
# generated prior to 1.3.0.
6769
pid = Process.spawn(
70+
ENV["GEM_HOME"] == "" ? { "GEM_HOME" => nil } : {},
6871
"ruby",
6972
"-r", "spring/server",
7073
"-e", "Spring::Server.boot"

0 commit comments

Comments
 (0)