aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2010-04-23 10:09:14 -0700
committerAndre Arko <andre@arko.net>2010-04-23 10:09:14 -0700
commite991f99ccef368ed468de99679cbbacaf97f74e5 (patch)
tree7d23adf617b80b5ca947b597a6d83a69283a950e /lib
parentecf81a6c376071d29f3102ea50f9195d12da6946 (diff)
downloadbundler-e991f99ccef368ed468de99679cbbacaf97f74e5.tar.gz
Don't raise when unable to write env.rb
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/environment.rb18
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