Rails 4,Capistrano 3.0.0,无法加载此类文件 - 部署

mar*_*cks 45 capistrano ruby-on-rails ruby-on-rails-4

我刚刚运行捆绑更新,capistrano已更新到3.0.0但现在当我运行cap deploy时,我收到错误,无法弄清楚如何解决这个问题.在这次更新之前,我每天都在更新我的服务器而没有任何问题.

cap aborted!
cannot load such file -- deploy
/home/mark/rails_apps/myapp/Capfile:1:in `load'
/home/mark/rails_apps/myapp/Capfile:1:in `<top (required)>'
Run Code Online (Sandbox Code Playgroud)

capfile

load 'deploy'
load 'deploy/assets'
load 'config/deploy' # remove this line to skip loading any of the default tasks
Run Code Online (Sandbox Code Playgroud)

mar*_*cks 39

我不得不宝石卸载capistrano和选择版本3.0.0

(即将宝石降级为2.x)

  • 你显然运行捆绑更新?我现在已将我的版本修复为2.15.5.所以在我看到关于这个主题的教程之前,它不会再次更新. (6认同)

pas*_*llo 21

我不得不跑 gem uninstall capistrano

然后使用更新gemfile gem 'capistrano', '~> 2.15'

然后再次运行以重新安装正确的版本 bundle update capistrano


ste*_*oks 18

确保你使用bundle exec(很可能你有多个gemist版本的capistrano)

bundle exec cap -T


H6.*_*H6. 8

而不是降级到Capistrano 2使用当前版本的新配置.

require "capistrano/bundler"
require "capistrano/rails/assets"
require "capistrano/rails/migrations"
Run Code Online (Sandbox Code Playgroud)

另见这篇精彩的帖子,总结了Capistrano 2和3之间的区别.