heroku: Gemfile.lock is required issue

余生颓废 提交于 2019-11-28 09:52:24

Few things

  1. Did you placed Gemfile.lock in git? if yes, is it lock (means updated? - you did several times just double check)
  2. Just do bundle install on your local prompt.
  3. now place Gemfile.lock
    • git add . or you can add only Gemfile.lock with this git add Gemfile.lock
    • git commit -m "commit message here"
    • git push

Now do git push heroku it should work.

On your development machine run rm -rf .bundle && bundle install && git add Gemfile.lock && git commit -m "Added Gemfile.lock" Then deploy.

Most likely your Gemfile.lock is not committed to your repository. Use git st and ensure that the Gemfile.lock is committed; check your .gitignore file to make sure that you're not accidentally ignoring it.

Check your .gitignore file, if you put Gemfile.lock there, get rid of that line and run this commands:

git add Gemfile.lock
git commit -m "Added Gemfile.lock"
git push
git push heroku

It's telling you that you need to push a Gemfile.lock - that's how Heroku knows what versions of gems your application is using. After bundling locally, commit the resultant Gemfile.lock then push the application to Heroku.

I had this problem, I forgot the bundle install

After it and git & Heroku everything went OK
Don't forget either the git remote

after writing your code the sequence would be :

bundle install
heroku create
git init
git add *
git remote
git commit -a -m "First init"
git push heroku master 

I think it's complete

Just remove the /Gemfile.lock from your .gitignore

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!