我正在使用capistrano,unicorn,rbenv,nginx,linode,ubuntu 12.04部署我的第一个Rails应用程序。我跑的时候
bin / cap deploy:cold
在我的应用根目录中,我收到以下错误:
* 2012-10-31 01:19:36 executing `bundle:install'
* executing "cd /home/mr_deployer/apps/prjct_mngr/releases/20121031001933 && bundle install --gemfile /home/mr_deployer/apps/prjct_mngr/releases/20121031001933/Gemfile --path /home/mr_deployer/apps/prjct_mngr/shared/bundle --deployment --quiet --without development test"
servers: ["xxxxxxxxxxxxx"]
[xxxxxxxxxxxxx] executing command
** [out :: xxxxxxxxxxxxx] Could not find rake-0.9.2.2 in any of the sources
** [out :: xxxxxxxxxxxxx] Run `bundle install` to install missing gems.
command finished in 1046ms
*** [deploy:update_code] rolling back
* executing "rm -rf /home/mr_deployer/apps/prjct_mngr/releases/20121031001933; true"
servers: ["xxxxxxxxxxxxx"]
[xxxxxxxxxxxxx] executing command
command finished in 625ms
failed: "sh -c 'cd /home/mr_deployer/apps/prjct_mngr/releases/20121031001933 && bundle install --gemfile /home/mr_deployer/apps/prjct_mngr/releases/20121031001933/Gemfile --path /home/mr_deployer/apps/prjct_mngr/shared/bundle --deployment --quiet --without development test'" on xxxxxxxxxxxxx
我在开发机器上运行了bundle install --path vendor / bundle,并且在dev机器和linode vps上都安装了gem rake。为什么它找不到耙子?
更新:
我尝试在linode上将我的rake gem的路径添加到linode上的bashrc和deploy.rb文件中的:default_envoronment。仍然得到同样的错误...
答案 0 :(得分:0)
尝试在capistrano receipe中指定您的路径,例如:
default_environment["PATH"] = "/usr/local/bin:/usr/bin:/usr/local/rvm/bin/:/var/lib/gems/1.9.1/bin"
如果您不知道如何查看路径,请通过ssh连接到服务器并运行命令
echo $PATH
答案 1 :(得分:0)
Capistrano尝试在部署服务的远程计算机上运行命令cd /home/mr_deployer/apps/prjct_mngr/releases/20121031001933 && bundle install --gemfile /home/mr_deployer/apps/prjct_mngr/releases/20121031001933/Gemfile --path /home/mr_deployer/apps/prjct_mngr/shared/bundle --deployment --quiet --without development test
。
看起来远程节点没有rake
安装bundle
尝试使用。
也许您应该检查远程机器上是否安装了所有必需的宝石。
答案 2 :(得分:0)
此错误并不表示您要部署到的计算机上未安装rake。此错误意味着Bundler在尝试安装您的gem时,无法在Gemfile中列出的源中找到Rake版本0.9.2.2。您的Gemfile是否包含source "http://rubygems.org"
之类的行?