Skip to content

Commit bb4a46e

Browse files
committed
Make sure the bundler environment is correct
We need an unbundled env and after removing spring we need to make sure the Gemfile.lock is updated.
1 parent df7788f commit bb4a46e

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

lib/spring/application_manager.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def stop
9393
def start_child(preload = false)
9494
@child, child_socket = UNIXSocket.pair
9595

96-
Bundler.with_original_env do
96+
Bundler.with_unbundled_env do
9797
bundler_dir = File.expand_path("../..", $LOADED_FEATURES.grep(/bundler\/setup\.rb$/).first)
9898
@pid = Process.spawn(
9999
{

test/support/acceptance_test.rb

+3-2
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ def exec_name
271271
test "binstub when spring gem is missing" do
272272
without_gem "spring-#{Spring::VERSION}" do
273273
File.write(app.gemfile, app.gemfile.read.gsub(/gem 'spring.*/, ""))
274+
app.run! "bundle install", timeout: nil
274275
assert_success "bin/rake -T", stdout: "rake db:migrate"
275276
end
276277
end
@@ -540,7 +541,7 @@ def exec_name
540541
File.write(app.path("script.rb"), <<-RUBY.strip_heredoc)
541542
gemfile = Rails.root.join("Gemfile")
542543
File.write(gemfile, "\#{gemfile.read}gem 'text'\\n")
543-
Bundler.with_clean_env do
544+
Bundler.with_unbundled_env do
544545
system(#{app.env.inspect}, "bundle install")
545546
end
546547
output = `\#{Rails.root.join('bin/rails')} runner 'require "text"; puts "done";'`
@@ -557,7 +558,7 @@ def exec_name
557558
File.write(app.path("script.rb"), <<-RUBY.strip_heredoc)
558559
gemfile = Rails.root.join("gems.rb")
559560
File.write(gemfile, "\#{gemfile.read}gem 'text'\\n")
560-
Bundler.with_clean_env do
561+
Bundler.with_unbundled_env do
561562
system(#{app.env.inspect}, "bundle install")
562563
end
563564
output = `\#{Rails.root.join('bin/rails')} runner 'require "text"; puts "done";'`

test/support/application.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ def spring_client_config
111111
def run(command, opts = {})
112112
start_time = Time.now
113113

114-
Bundler.with_original_env do
114+
Bundler.with_unbundled_env do
115115
Process.spawn(
116116
env.merge(opts[:env] || {}),
117117
command.to_s,

test/support/application_generator.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def system(command)
3131
end
3232

3333
def generate
34-
Bundler.with_original_env { generate_files }
34+
Bundler.with_unbundled_env { generate_files }
3535
install_spring
3636
generate_scaffold
3737
end

0 commit comments

Comments
 (0)