0
votes

I am trying to move my development environment from my local machine to vagrant. I setup vagrant Ubuntu 14.04 amd64 box. I installed RVM, ruby, mysql, and many other requirements for rails development environment.

Finally i cd into rails root directory (which is shared with Windows 7 host) and run "bundle install", i get the error:

..
Resolving dependencies.....
Installing rake 10.1.1

Errno::EPERM: Operation not permitted @ rb_sysopen - /vagrant/bin /rake
An error occurred while installing rake (10.1.1), and Bundler cannot continue.
Make sure that `gem install rake -v '10.1.1'` succeeds before bundling.
..

I have rails 3.2.17, ruby 2.2.1 and bundler 1.9.1. I tried many different things such as chown /vagrant, remount with 777 mount_options, bundle install --path .bundle and so on, but none of them works.

Help me!

By the way this is the result of "bundle install --verbose"

..
Resolving dependencies.....
Using rake 10.1.1
0:  rake (10.1.1) from /vagrant/.bundle/ruby/2.2.0/specifications/rake-10.1.1.gemspec

Errno::EPERM: Operation not permitted @ rb_sysopen - /vagrant/bin /rake
/home/vagrant/.rvm/gems/ruby-2.2.1@global/gems/bundler-1.9.1/lib/bundler/installer.rb:175:in `initialize'
/home/vagrant/.rvm/gems/ruby-2.2.1@global/gems/bundler-1.9.1/lib/bundler/installer.rb:175:in `open'
/home/vagrant/.rvm/gems/ruby-2.2.1@global/gems/bundler-1.9.1/lib/bundler/installer.rb:175:in `block in generate_bundler_executable_stubs'
/home/vagrant/.rvm/gems/ruby-2.2.1@global/gems/bundler-1.9.1/lib/bundler/installer.rb:166:in `each'
/home/vagrant/.rvm/gems/ruby-2.2.1@global/gems/bundler-1.9.1/lib/bundler/installer.rb:166:in `generate_bundler_executable_stubs'
/home/vagrant/.rvm/gems/ruby-2.2.1@global/gems/bundler-1.9.1/lib/bundler/installer.rb:117:in `install_gem_from_spec'
/home/vagrant/.rvm/gems/ruby-2.2.1@global/gems/bundler-1.9.1/lib/bundler/installer.rb:263:in `block in install_sequentially'
..
1

1 Answers

0
votes

I have finally found the solution. I think this is a bug in bundler. Bundler set the "BUNDLE_BIN" variable to 'bin ' (note the extra space) which causes the ruby code "File.open(binstub_path .." to throw error because ruby can not open "/vagrant/bin /rake" (note the extra space).

After i edited the ".bundle/config" file and set BUNDLE_BIN to 'bin' (removed space), "bundle install" worked fine.