我使用capistrano基於RailsCasts指南部署到VPS。 http://railscasts.com/episodes/335-deploying-to-a-vps?view=asciicast調試Capistrano
它在部署:冷命令失敗,與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,這顯然不理想。
看起來像你正在使用rbenv你的紅寶石安裝 - 你可能想結帳這篇文章:http://henriksjokvist.net/archive/2012/2/deploying-with-rbenv-and-capistrano/ - 'set: default_environment,{ 'PATH'=>「$ HOME/.rbenv/shims:$ HOME/.rbenv/bin:$ PATH」 }' – house9