Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ruby-on-rails-3/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails 3 Vagrant Rails共享文件夹绑定器错误_Ruby On Rails 3_Vagrant_Bundler - Fatal编程技术网

Ruby on rails 3 Vagrant Rails共享文件夹绑定器错误

Ruby on rails 3 Vagrant Rails共享文件夹绑定器错误,ruby-on-rails-3,vagrant,bundler,Ruby On Rails 3,Vagrant,Bundler,我正试图将我的开发环境从本地机器转移到vagrant。我安装了vagrant Ubuntu14.04 amd64盒。我为rails开发环境安装了RVM、ruby、mysql和许多其他需求 最后,我将cd放入与Windows 7主机共享的rails根目录并运行捆绑安装,我得到错误: .. Resolving dependencies..... Installing rake 10.1.1 Errno::EPERM: Operation not permitted @ rb_sysopen - /

我正试图将我的开发环境从本地机器转移到vagrant。我安装了vagrant Ubuntu14.04 amd64盒。我为rails开发环境安装了RVM、ruby、mysql和许多其他需求

最后,我将cd放入与Windows 7主机共享的rails根目录并运行捆绑安装,我得到错误:

..
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.
..
我有rails 3.2.17、ruby 2.2.1和bundler 1.9.1。 我尝试了许多不同的方法,比如chown/vagrant、使用777 mount_选项重新安装、bundle安装-path.bundle等等,但没有一种方法有效

救救我

顺便说一句,这是bundle安装-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'
..

我终于找到了解决办法。我认为这是bundler中的一个bug。Bundler将BUNDLE\u BIN变量设置为“BIN”,注意导致ruby代码文件.openbinstub\u路径的额外空间。。抛出错误,因为ruby无法打开/vagrant/bin/rake,请注意额外的空间

编辑.bundle/config文件并将bundle_BIN设置为“BIN”删除空间后,bundle安装工作正常