【问题标题】:Unable to deploy to heroku无法部署到heroku
【发布时间】:2016-10-19 23:29:29
【问题描述】:

我正在尝试将我的应用程序部署到 heroku,但它要求我将更新后的 Gemfile.lock 添加到版本控制中。日志是:

remote: -----> Fetching set buildpack https://github.com/ello/heroku-buildpack-imagemagick... done
remote: -----> ImageMagick app detected
remote: -----> Install ImageMagick
remote: -----> Extracting ImageMagick /app/tmp/cache/imagemagick.tar.gz => /tmp/build_397f5ab6d29af054b826b2a1303ae32b/vendor
remote: -----> Writing policy file
remote: -----> Updating environment variables
remote: -----> Using set buildpack heroku/ruby
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.2.0
remote: -----> Installing dependencies using bundler 1.11.2
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        You are trying to install in deployment mode after changing
remote:        your Gemfile. Run `bundle install` elsewhere and add the
remote:        updated Gemfile.lock to version control.
remote:        You have added to the Gemfile:
remote:        * source:

它要求我添加更新的 Gemfile.lock,但是当我删除它并生成一个新的时仍然不起作用。我已经尝试过各种 S.O. 中提到的解决方案。问题,但没有一个对我有用。 另外,我已经上演并承诺了。

【问题讨论】:

  • 看来您还没有上传所有部署过程的消息。除此之外,如果您可以添加heroku log,将更容易评估问题。

标签: ruby-on-rails ruby-on-rails-4 heroku heroku-toolbelt


【解决方案1】:

确保你运行bundle install 这将自动生成 gemfile.lock。 Gemfile.lock 是记录您的所有版本以及您安装的 gem 的文件,它将在您第一次运行 bundle install 时生成,并且当您将来运行相同的命令时,它将首先查看 gemfile.lock 到检查要安装的版本和 gem。

一旦你运行 bundle install 然后尝试所有命令来部署你的应用程序

git init

git add . 

git commit -am "some comment"

git push heroku master 

【讨论】:

    【解决方案2】:

    似乎您没有将 Gemfile.lock 提交给 git。确保你承诺了。如果你想在 Heroku 上部署 Gemfile.lock 是必需的

    步骤: 1)Git状态

    2) 它会显示你已修改:Gemfile.lock

    3) git commit Gemfile.lock -m "comment"

    4) git push origin "分支名称"

    5) 尝试使用此分支进行部署。

    【讨论】:

    • 尝试更新包,然后提交你的 Gemfile.lock
    • 是的,我该怎么办?
    猜你喜欢
    • 2017-02-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-10-21
    • 1970-01-01
    • 2017-12-09
    • 1970-01-01
    相关资源
    最近更新 更多