我有一个菜鸟问题,我是新手上的服务器部署。目前的设置是Nginx和unicorn,Rails 4.0.0和Ruby 2.0.0-p247。
当我尝试使用capistrano将rails应用程序部署到远程VPS时遇到问题。我跟着RailsCast http://railscasts.com/episodes/335-deploying-to-a-vps并准备好了一切。当我这样做时:
cap deploy:setup
发生以下错误:
* executing "mkdir -p /var/www/blog /var/www/blog/releases /var/www/blog/shared /var/www/blog/shared/system /var/www/blog/shared/log /var/www/blog/shared/pids"
servers: ["123.123.123.123"]
[123.123.123.123] executing command
** [out :: 123.123.123.123] env:
** [out :: 123.123.123.123] /root/.rvm/bin/rvm-shell
** [out :: 123.123.123.123] : No such file or directory
....
failed: "env PATH=/usr/local/rvm/bin rvm_path=/usr/local/rvm/bin rvm_path=$HOME/.rvm $HOME/.rvm/bin/rvm-shell 'default' -c 'mkdir -p /var/www/blog /var/www/blog/releases /var/www/blog/shared /var/www/blog/shared/system /var/www/blog/shared/log /var/www/blog/shared/pids'" on 123.123.123.123
当我与which rvm-shell
核实时,我得到了/usr/local/rvm/bin/rvm-shell
。我想知道为什么脚本会尝试在/root/.rvm/bin/rvm-shell
中找到..但我不知道如何让部署脚本找到rvm-shell ..
需要帮助!谢谢!
答案 0 :(得分:0)
您可以在deploy.rb中设置环境:
set:default_environment,{
'PATH' => "/usr/local/rvm/bin/rvm-shell:/xxx/xxx"
}