2012-10-31 86 views
0

我使用capistrano,独角兽,rbenv,nginx,linode,Ubuntu 12.04部署我的第1 Rails应用程序。当我运行Rails capistrano部署找不到耙

斌/帽部署:在我的应用程序根冷

,我收到以下错误回:

* 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 

我已经运行包安装--path供应商/捆绑在我的开发机器上,并且gem rake安装在dev机器和linode vps上。为什么不能找到耙子?

UPDATE:

我已经试过的Linode加入我的耙宝石的路径,我都对.bashrc中的Linode和:在deploy.rb文件default_envoronment。仍然得到同样的错误...

回答

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 
+0

我已经完成了这个,但仍然是相同的错误... – oFca

+0

因此,首先尝试运行“cap your_deploy_receipe_name bundle:install”。之后,用capistrano使用的用户登录到服务器,然后尝试运行失败的命令(这将是我想的捆绑安装)。它有效吗?如果不是,则需要将目录添加到$ PATH中。 – zachar

+0

不知道我能做到这一点,thx!将检查出来!只是不知道这个'your_deploy_recipe_name'是什么意思?你可以说得更详细点吗?那是deploy.rb文件吗? – oFca

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试图使用。

也许你应该检查所有必要的宝石是否安装在远程机器上。

+0

运行gem list显示rake确实存在于远程机器上。你的意思是检查那样或? – oFca

0

此错误并不表示您要部署到的机器上未安装耙机。这个错误意味着Bundler在试图安装你的gem时,无法在Gemfile中列出的源中找到Rake版本0.9.2.2。你的Gemfile是否包含如source "http://rubygems.org"这样的行?

+0

是的,它的确如此。但我没有耙在宝石文件...顺便说一句,我必须帽部署:设置帽部署之前:冷每次我改变我的Gemfile? – oFca