我正在尝试通过Github将一个Rails 4应用程序部署到Webfaction,通过Capistrano 2.15.5。最初我安装了Capistrano 3并且遇到了错误,所以我最终安装了Capistrano 2.15.5并关注了webfaction的文档here:
我谈到了webfaction,他们建议我尝试使用旧的Cap 2版本,因为这是他们熟悉的内容,并且暂时不会为Capistrano 3更新他们的文档。
我在他们的教程中完成了所有相应的步骤,在尝试运行“cap deploy:setup”或“cap deploy:check”等时出现了一些错误。
pastebin中的错误here :(并在下面显示)
/Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:152:in `require': cannot load such file -- capistrano/setup (LoadError)
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:152:in `require'
from Capfile:6:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:93:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:180:in `load_from_file'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:89:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `each'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `each'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `load_recipes'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:31:in `execute!'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:14:in `execute'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/bin/cap:4:in `<top (required)>'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `<main>'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `eval'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `<main>'
galactica% cap deploy:check
/Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:152:in `require': cannot load such file -- capistrano/setup (LoadError)
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:152:in `require'
from Capfile:6:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:93:in `instance_eval'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:93:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:180:in `load_from_file'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:89:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `block in load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `each'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/configuration/loading.rb:86:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `block in load_recipes'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `each'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:65:in `load_recipes'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:31:in `execute!'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/lib/capistrano/cli/execute.rb:14:in `execute'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/gems/capistrano-2.15.5/bin/cap:4:in `<top (required)>'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `load'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/cap:23:in `<main>'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `eval'
from /Users/aronoff/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `<main>'
我已经尝试过查看文件,但我不确定问题是什么,我不知道足够的红宝石来排除故障。我希望你能帮助我。
任何帮助都将立即受到赞赏和gittipp'ed !! :)
提前谢谢! 〜约什
答案 0 :(得分:3)
我猜你用Capistrano 3设置你的项目配置,我认为Capistrano 2的设置是不同的。
我对这些差异并不太熟悉,但您收到的错误是cannot load such file -- capistrano/setup
和this post关于capistrano 3引用require 'capistrano/setup'
的{{1}} capistrano 3产生的。
所以我猜测capistrano 2不存在该文件。我不知道capistrano 2是否有可以运行的生成器并让它们覆盖你拥有的文件,但是如果有,请尝试吗? / p>
或尝试取出该行,看看是否有其他错误?或者还原你开始设置capistrano 3的提交并使用capistrano 2完全开始配置过程?
答案 1 :(得分:0)
您是否在ruby v2.0下使用“gem install”安装了Capistrano 2?
rvm 2.0.0 宝石安装capistrano“你的版本”
先试试......
答案 2 :(得分:0)
使用上限2.15.5部署rails 4应用程序时遇到了同样的错误。我做了研究,发现问题是语法,因为我从第3章切换到第2章。因此,如果您使用cap v2,则仅在capfile中加载命令工作,而Require命令仅在deploy.rb中使用。因此,如果您从3切换到2,请记住语法,因为cap v2和cap v3之间有很多变化。
注意:对于部署rails 4,应用程序2.15.5是您可以使用的稳定的capistrano版本。以下是适用于我的指南链接:https://gist.github.com/brobertsaz/8660415