diff options
author | Andre Arko <andre@arko.net> | 2010-04-23 10:09:14 -0700 |
---|---|---|
committer | Andre Arko <andre@arko.net> | 2010-04-23 10:09:14 -0700 |
commit | e991f99ccef368ed468de99679cbbacaf97f74e5 (patch) | |
tree | 7d23adf617b80b5ca947b597a6d83a69283a950e /lib | |
parent | ecf81a6c376071d29f3102ea50f9195d12da6946 (diff) | |
download | bundler-e991f99ccef368ed468de99679cbbacaf97f74e5.tar.gz |
Don't raise when unable to write env.rb
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/environment.rb | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/lib/bundler/environment.rb b/lib/bundler/environment.rb index 63e3cacc..f103b9a0 100644 --- a/lib/bundler/environment.rb +++ b/lib/bundler/environment.rb @@ -92,13 +92,17 @@ module Bundler end def write_rb_lock - env_file = Bundler.default_gemfile.dirname.join(".bundle/environment.rb") - env_file.dirname.mkpath - File.open(env_file, 'w') do |f| - f.puts <<-RB -require "rubygems" -require "bundler/setup" - RB + begin + env_file = Bundler.default_gemfile.dirname.join(".bundle/environment.rb") + env_file.dirname.mkpath + File.open(env_file, 'w') do |f| + f.puts <<-RB + require "rubygems" + require "bundler/setup" + RB + end + rescue Errno::EACCES + Bundler.ui.warn "Cannot write .bundle/environment.rb file" end end |