首页 文章

Rails capistrano部署找不到佣金

提问于
浏览
0

我正在使用capistrano,unicorn,rbenv,nginx,linode,ubuntu 12.04部署我的第一个Rails应用程序 . 我跑的时候

bin / cap deploy:冷

在我的应用程序根目录中,我收到以下错误:

* 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 . 为什么它找不到耙子?

更新:

我已经尝试将linke上我的rake gem的路径添加到linode上的bashrc和deploy.rb文件中的:default_envoronment . 仍然得到同样的错误......

3 回答

  • 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

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

  • 0

    尝试在capistrano receipe中指定您的路径,例如:

    default_environment["PATH"] = "/usr/local/bin:/usr/bin:/usr/local/rvm/bin/:/var/lib/gems/1.9.1/bin"
    

    如果您不知道如何查看路径,请通过ssh和run命令连接到服务器

    echo $PATH
    

相关问题