Ruby on rails Rails capistrano部署找不到rake
我正在使用capistrano、unicorn、rbenv、nginx、linode、Ubuntu12.04部署我的第一个Rails应用程序。当我跑的时候 箱/盖展开:冷 在我的应用程序根目录中,我返回以下错误:Ruby on rails Rails capistrano部署找不到rake,ruby-on-rails,deployment,capistrano,Ruby On Rails,Deployment,Capistrano,我正在使用capistrano、unicorn、rbenv、nginx、linode、Ubuntu12.04部署我的第一个Rails应用程序。当我跑的时候 箱/盖展开:冷 在我的应用程序根目录中,我返回以下错误: * 2012-10-31 01:19:36 executing `bundle:install' * executing "cd /home/mr_deployer/apps/prjct_mngr/releases/20121031001933 && bundl
* 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安装——path vendor/bundle,gem-rake安装在dev机器和linode vps上。为什么它找不到耙子
更新:
我已经尝试将linode上rake gem的路径添加到我的linode上的bashrc和deploy.rb文件中的:default_环境中。仍然收到相同的错误…请尝试在capistrano receipe中指定您的路径,例如:
default_environment["PATH"] = "/usr/local/bin:/usr/bin:/usr/local/rvm/bin/:/var/lib/gems/1.9.1/bin"
如果您不知道路径的外观,请通过ssh连接到服务器并运行命令
echo $PATH
Capistrano尝试运行命令
cd/home/mr_deployer/apps/prjct_mngr/releases/20121031001933&&bundle安装--gemfile/home/mr_deployer/apps/prjct_mngr/releases/20121031001933/gemfile--path/home/mr_deployer/apps/prjct_mngr/shared/bundle--部署--安静--无需在您提供服务的远程计算机上进行开发测试
部署到
看起来远程节点没有安装试图使用的rake
捆绑包
也许您应该检查远程计算机上是否安装了所有必要的gem。此错误并不表示您部署到的计算机上没有安装rake。此错误意味着Bundler在尝试安装gems时,无法在gems文件中列出的源代码中找到Rake版本0.9.2.2。您的文件是否包含类似于
source”的行http://rubygems.org“
?因此,首先尝试运行“cap your\u deploy\u receipe\u name bundle:install”。之后,使用capistrano使用的用户登录到服务器,并尝试运行失败的命令(我想是捆绑安装)。它有效吗?如果没有,你需要将目录添加到你的$PATH。不知道我可以这样做,谢谢!我来看看!只是不知道你说的“你的配方”是什么意思?你能说得更具体些吗?那是deploy.rb文件吗?capistrano是一个非常强大的工具。运行“cap-T”列出所有命令。如果您需要多阶段(应用程序的几个实例,例如测试、暂存、生产),那么您使用的是“您的部署方法名称”。好的,那么我只是运行cap bundle安装?顺便说一句,我检查了gem环境,我的gem在我的vps上,rake正确地在那里…我已经运行了:cap bundle:install。它说这个>无法检测当前的发布路径-确保您至少部署了一次。运行gem list表明远程机器上确实存在rake。你是说像那样检查吗?是的。但我在gem文件中没有rake。。。顺便说一句,每次更改文件时,是否必须在cap deploy:cold之前安装cap deploy:setup?