无法部署到heroku

时间:2016-06-18 04:21:44

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

我正在尝试将我的应用部署到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.上提到的解决方案。问题,但它们都不适合我。 此外,我已经上演并承诺。

2 个答案:

答案 0 :(得分:0)

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

步骤: 1)Git状态

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

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

4)git push origin"分支名称"

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

答案 1 :(得分:0)

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

运行bundle install后,尝试使用所有命令部署应用

git init

git add . 

git commit -am "some comment"

git push heroku master 
相关问题