【问题标题】:Capistrano could not locate Gemfile error on application deploymentCapistrano 在应用程序部署中找不到 Gemfile 错误
【发布时间】:2014-06-28 16:53:21
【问题描述】:

我正在尝试将我的 Rails 应用程序部署到生产服务器,我决定使用 this guide + RVM 将其部署到 DigitalOcean。

要部署,我使用以下命令:

cap production deploy

但是,它在某些需要 gemfile 的部分失败。以下是部署失败的日志:

DEBUG[323dfd0e] Command: cd /home/deploy/zwiadowcy/releases/20140628164657 && ~/.rvm/bin/rvm default do bundle install --binstubs /home/deploy/zwiadowcy/shared/bin --path
/home/deploy/zwiadowcy/shared/bundle --without development test --deployment --quiet
DEBUG[323dfd0e]     Could not locate Gemfile
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host my_ip_address: bundle exit status: 10
bundle stdout: Nothing written
bundle stderr: Nothing written

我的 gemfile 已经包含了所有需要的东西:

gem 'capistrano', '~> 3.1.0'
gem 'capistrano-bundler', '~> 1.1.2'
gem 'capistrano-rails', '~> 1.1.1'
gem 'capistrano-rvm', github: "capistrano/rvm"

我已经用谷歌搜索了一半的互联网并尝试了很多东西,在这里查看了很多问题,我现在真的不知道该怎么做,所以我请你帮忙。谢谢!

【问题讨论】:

  • 你的 Gemfile 确定签入了吗?
  • 我如何检查这个?
  • 检查您的存储库中是否正在跟踪 Gemfile?或者查看:.gitignore 项目根目录下的文件,如果你错误地将 Gemfile 放在那里?
  • 是的,正在跟踪 Gemfile。

标签: ruby-on-rails deployment capistrano remote-server gemfile


【解决方案1】:

验证 GemfileGemfile.lock 是否在 Git 中被选中。例如你可以运行:

git log Gemfile
git log Gemfile.lock

您还可以验证这些文件是否存在于服务器上的/home/deploy/zwiadowcy/releases/20140628164657 中。

在服务器中手动运行命令也有帮助:

cd /home/deploy/zwiadowcy/releases/20140628164657 && ~/.rvm/bin/rvm default do bundle install --binstubs /home/deploy/zwiadowcy/shared/bin --path /home/deploy/zwiadowcy/shared/bundle --without development test --deployment

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-07-03
    • 1970-01-01
    • 2019-04-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多