ard*_*igh 5 capistrano ruby-on-rails web-deployment
我正在使用capistrano部署到VPS,基于RailsCasts的指南. http://railscasts.com/episodes/335-deploying-to-a-vps?view=asciicast
它在deploy:cold命令失败,与Ruby发生冲突.我实际上看不出问题是什么,因为当我对同一个用户进行shell时,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]
Run Code Online (Sandbox Code Playgroud)
这是错误:
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
Run Code Online (Sandbox Code Playgroud)
我的问题是:我该怎么调试呢?当我读取deploy.rb文件时,我看不到它甚至引用Ruby版本的位置.非常令人沮丧,我准备好将repo up起来,这显然不太理想.
好吧,我终于找到了问题的根源--Capistrano使用的ruby版本与服务器上的实际内容之间存在不匹配.
要调试Capistrano,请按以下方式运行:
cap deploy:cold -d
Run Code Online (Sandbox Code Playgroud)
那就是您可以逐步执行命令并在删除之前访问远程服务器上的临时目录.
我刚刚遇到了类似的问题,原因是.ruby-version文件指向1.9.3(文件是由rails-composer生成的),而1.9.3-p392远程机器上是通过rbenv安装的。
| 归档时间: |
|
| 查看次数: |
8494 次 |
| 最近记录: |