gpt4 book ai didi

ruby-on-rails - 调试 Capistrano

转载 作者:行者123 更新时间:2023-12-04 17:22:48 27 4
gpt4 key购买 nike

我正在根据 RailsCasts 上的指南使用 capistrano 部署到 VPS。
http://railscasts.com/episodes/335-deploying-to-a-vps?view=asciicast

它在 上失败了部署:冷 命令,与 Ruby 有冲突。我实际上看不出问题是什么,因为当我进入同一用户时,Ruby 版本看起来是正确的。

$ cap shell
cap> which ruby
[establishing connection(s) to 192.xxx.xxx.xxx]
** [out :: 192.xxx.xxx.xxx] /home/deployer/.rbenv/shims/ruby
cap> ruby -v
** [out :: 192.xxx.xxx.xxx ruby 1.9.3p327 (2012-11-10 revision 37606) [x86_64-linux]

这是错误:
command finished in 655ms
* 2013-07-01 16:40:39 executing `bundle:install'
* executing "cd /home/deployer/rails/assay/releases/20130701144038 && bundle install -- gemfile /home/deployer/rails/assay/releases/20130701144038/Gemfile --path /home/deployer/rails/assay/shared/bundle --deployment --quiet --without development test"
servers: ["192.xxx.xxx.xxx"]
[192.xxx.xxx.xxx] executing command
** [out :: 192.xxx.xxx.xxx] rbenv: version `1.9.3' is not installed
command finished in 662ms
*** [deploy:update_code] rolling back

我的问题是: 我该如何调试? 当我阅读 deploy.rb 文件,我什至看不到它在哪里引用了 Ruby 版本。非常令人沮丧,我即将准备 ftp repo ,这显然并不理想。

最佳答案

好吧,我终于找到了问题的根源——Capistrano 使用的 ruby​​ 版本与服务器上的实际版本不匹配。

要调试 Capistrano,请像这样运行它:

cap deploy:cold  -d

也就是说,您可以在删除命令之前逐步执行命令并访问远程服务器上的临时目录。

关于ruby-on-rails - 调试 Capistrano,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17409191/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com