在 capistrano 部署上找不到 rake

发布于 2024-12-16 20:26:56 字数 1082 浏览 5 评论 0原文

因此,我尝试使用 RVM 通过 nginx/unicorn 服务器获取 capistrano 部署设置。

部署工作正常,但是当我尝试通过 capistrano 与 unicorn 交互时,我收到如下错误:

[~/source/quibbler/config]
$ cap unicorn:start
  * executing `unicorn:start'
  * executing "cd /u/apps/quibbler/current && bundle exec unicorn_rails -c /u/apps/quibbler/current/config/unicorn-production.rb -E production -D"
    servers: ["wwwtestvm.whf.app"]
    [wwwtestvm.whf.app] executing command
 ** [out :: wwwtestvm.whf.app] Could not find rake-0.9.2 in any of the sources
    command finished in 553ms
failed: "rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'ruby-1.9.2-p290@quibbler' -c 'cd /u/apps/quibbler/current && bundle exec unicorn_rails -c /u/apps/quibbler/current/config/unicorn-production.rb -E production -D'" on wwwtestvm.whf.app

我整夜搜索了互联网,但找不到解决方案。如果我将命令复制粘贴到 shell 中,它就会起作用,因此我 99% 确定它与 RVM 环境不正确有关。

我已经创建了部署和独角兽配置的要点:

https://gist.github.com/1375736 #file_deploy.rb 指导

任何帮助或 将不胜感激。

So I am attempting to get a capistrano deployment setup with an nginx/unicorn server, using RVM.

The deploy works, but when I attempt to interact with unicorn via capistrano i get an error like:

[~/source/quibbler/config]
$ cap unicorn:start
  * executing `unicorn:start'
  * executing "cd /u/apps/quibbler/current && bundle exec unicorn_rails -c /u/apps/quibbler/current/config/unicorn-production.rb -E production -D"
    servers: ["wwwtestvm.whf.app"]
    [wwwtestvm.whf.app] executing command
 ** [out :: wwwtestvm.whf.app] Could not find rake-0.9.2 in any of the sources
    command finished in 553ms
failed: "rvm_path=/usr/local/rvm /usr/local/rvm/bin/rvm-shell 'ruby-1.9.2-p290@quibbler' -c 'cd /u/apps/quibbler/current && bundle exec unicorn_rails -c /u/apps/quibbler/current/config/unicorn-production.rb -E production -D'" on wwwtestvm.whf.app

I have searched the interwebs all night and can not find the solution. If I copy paste the command into my shell it works so I am 99% sure it has to do with the RVM environment not being correct.

I have created a gist of my deploy and unicorn configs:

https://gist.github.com/1375736#file_deploy.rb
https://gist.github.com/1375736#file_unicorn_production.rb

Any help or guidance would be appreciated.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

清晨说晚安 2024-12-23 20:26:56

感谢 sannankhalid 对此的回答 其他问题我能够解决它。

简短的回答:将 rake 添加到您的 Gemfile,确保运行 bundle install 以便更新您的 Gemfile.lock,然后部署到您的服务器,耶!

Thanks to sannankhalid answer on this other question i was able to resolve it.

Short answer: add rake to your Gemfile, make sure you run bundle install so your Gemfile.lock gets updated, then deploy to your server, ayay!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文