diff --git a/lib/bundler/setup.rb b/lib/bundler/setup.rb index 645320c011a..c94f707e6a9 100644 --- a/lib/bundler/setup.rb +++ b/lib/bundler/setup.rb @@ -7,7 +7,6 @@ if env_file.exist? require env_file else - require 'rubygems' require 'bundler' begin Bundler.setup diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb index 4e5705790b9..ca5905963a2 100644 --- a/lib/bundler/shared_helpers.rb +++ b/lib/bundler/shared_helpers.rb @@ -1,3 +1,4 @@ +require 'rubygems' require 'pathname' module Gem diff --git a/lib/bundler/templates/environment.erb b/lib/bundler/templates/environment.erb index 91ede348962..7b13ae725a3 100644 --- a/lib/bundler/templates/environment.erb +++ b/lib/bundler/templates/environment.erb @@ -2,7 +2,6 @@ # Generated by Bundler <%= Bundler::VERSION %> require 'digest/sha1' -require 'rubygems' <%= shared_helpers %> module Bundler diff --git a/spec/other/exec_spec.rb b/spec/other/exec_spec.rb index cf8c39f78f9..0bf7c60808d 100644 --- a/spec/other/exec_spec.rb +++ b/spec/other/exec_spec.rb @@ -92,18 +92,26 @@ end describe "when locked" do - it "uses .bundle/environment.rb" do + before :each do gemfile <<-G gem "rack" G - bundle "lock" + bundle :lock should_be_locked + end + + it "uses .bundle/environment.rb" do File.open(".bundle/environment.rb", 'a') { |f| f.puts "puts 'using environment.rb'" } bundle "exec rackup" out.should == "using environment.rb\n1.0.0" end + + it "loads the shared helpers successfully" do + bundle "exec ruby -e 'puts'" + err.should be_empty + end end describe "with gem binaries" do