捆绑安装致命错误

捆绑安装致命错误

我正在将我的项目迁移到一台新机器上,但在我尝试使用的机器上运行 bundle install 时遇到了问题。当我运行:

bundle install

我收到此错误:

Unfortunately, a fatal error has occurred. Please see the Bundler
troubleshooting documentation at http://bit.ly/bundler-issues. Thanks!
/home/zach/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/fileutils.rb:245:in `mkdir': Permission denied - /home/zach/HandCoOp/project/HandCo-op/vendor/bundle/ruby/2.0.0 (Errno::EACCES)
    from /home/zach/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/fileutils.rb:245:in `fu_mkdir'
    from /home/zach/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/fileutils.rb:219:in `block (2 levels) in mkdir_p'
    from /home/zach/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/fileutils.rb:217:in `reverse_each'
    from /home/zach/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/fileutils.rb:217:in `block in mkdir_p'
    from /home/zach/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/fileutils.rb:203:in `each'
    from /home/zach/.rvm/rubies/ruby-2.0.0-p451/lib/ruby/2.0.0/fileutils.rb:203:in `mkdir_p'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler.rb:294:in `mkdir_p'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/installer.rb:325:in `create_bundle_path'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/installer.rb:51:in `run'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/installer.rb:15:in `install'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/cli/install.rb:78:in `run'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/cli.rb:145:in `install'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/vendor/thor/command.rb:27:in `run'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/vendor/thor/invocation.rb:121:in `invoke_command'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/vendor/thor.rb:363:in `dispatch'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/vendor/thor/base.rb:440:in `start'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/cli.rb:9:in `start'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/bin/bundle:20:in `block in <top (required)>'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/lib/bundler/friendly_errors.rb:5:in `with_friendly_errors'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/gems/bundler-1.6.5/bin/bundle:18:in `<top (required)>'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/bin/bundle:23:in `load'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/bin/bundle:23:in `<main>'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/bin/ruby_executable_hooks:15:in `eval'
    from /home/zach/.rvm/gems/ruby-2.0.0-p451@global/bin/ruby_executable_hooks:15:in `<main>'

我已经运行了 gem install bundler,它成功运行了,并且我已确保我的 ruby​​ 版本与项目构建的版本相同,我的想法已经用尽,迷失了方向。感谢任何知道哪里出了问题并花时间帮助我的人。

output of ls -l:
total 20
drwxr-xr-x  2 root root 4096 Jul 24 17:52 bin
drwxr-xr-x  2 root root 4096 Jul 24 17:53 cache
drwxr-xr-x  2 root root 4096 Jul 24 17:51 doc
drwxr-xr-x 49 root root 4096 Jul 24 17:53 gems
drwxr-xr-x  2 root root 4096 Jul 24 17:53 specifications

cd..ls-l:

total 4
drwxrwxr-x 7 root root 4096 Jul 24 17:51 1.9.1

希望这有帮助!=D

答案1

在终端中运行这些命令应该可以解决这个问题。

rm -rf ~/.bundle/ ~/.gem/
rm -rf $GEM_HOME/bundler/ $GEM_HOME/cache/bundler/
rm -rf .bundle/
rm -rf vendor/cache/
rm -rf Gemfile.lock
bundle install

相关内容