如何在Capistrano重建Bundle?

时间:2015-10-19 23:06:58

标签: ruby-on-rails ruby capistrano bundler

我一直在努力更新使用Rbenv,Bundler和Capistrano的Rails应用程序,并且在远程服务器上安装Ruby之后,我的部署始终失败并出现以下情况:

DEBUG [c642111f]    rake aborted!
DEBUG [c642111f]    LoadError: cannot load such file -- rails/all
DEBUG [c642111f]    /home/deploy/domains/myapp/releases/20151019224651/config/application.rb:3:in `require'
DEBUG [c642111f]    /home/deploy/domains/myapp/releases/20151019224651/config/application.rb:3:in `<top (required)>'
DEBUG [c642111f]    /home/deploy/domains/myapp/releases/20151019224651/Rakefile:4:in `require'
DEBUG [c642111f]    /home/deploy/domains/myapp/releases/20151019224651/Rakefile:4:in `<top (required)>'
DEBUG [c642111f]    (See full trace by running task with --trace)
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@myapp.com: rake exit status: 1
rake stdout: Nothing written
rake stderr: rake aborted!
LoadError: cannot load such file -- rails/all
/home/deploy/domains/myapp/releases/20151019224651/config/application.rb:3:in `require'
/home/deploy/domains/myapp/releases/20151019224651/config/application.rb:3:in `<top (required)>'
/home/deploy/domains/myapp/releases/20151019224651/Rakefile:4:in `require'
/home/deploy/domains/myapp/releases/20151019224651/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

SSHKit::Command::Failed: rake exit status: 1
rake stdout: Nothing written
rake stderr: rake aborted!
LoadError: cannot load such file -- rails/all
/home/deploy/domains/myapp/releases/20151019224651/config/application.rb:3:in `require'
/home/deploy/domains/myapp/releases/20151019224651/config/application.rb:3:in `<top (required)>'
/home/deploy/domains/myapp/releases/20151019224651/Rakefile:4:in `require'
/home/deploy/domains/myapp/releases/20151019224651/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

Tasks: TOP => deploy:assets:precompile
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as deploy@myapp.com: rake exit status: 1
rake stdout: Nothing written
rake stderr: rake aborted!
LoadError: cannot load such file -- rails/all
/home/deploy/domains/myapp/releases/20151019224651/config/application.rb:3:in `require'
/home/deploy/domains/myapp/releases/20151019224651/config/application.rb:3:in `<top (required)>'
/home/deploy/domains/myapp/releases/20151019224651/Rakefile:4:in `require'
/home/deploy/domains/myapp/releases/20151019224651/Rakefile:4:in `<top (required)>'
(See full trace by running task with --trace)

如果我进入远程服务器并尝试be rails c路径中的releases/20151019224651等任务,我会收到相同的消息。

然而,我注意到,一旦我运行rm -rf .bundle,所有问题都会消失,一切都很好。

问题在于修复已中止的部署为时已晚,并且每次连续部署尝试都会遇到同样的问题。

这里可能会发生什么,我该如何解决这个问题?

0 个答案:

没有答案