Gemfile.lock not checked in – Heroku

While trying to “git push heroku master”, I keep getting the error :

Counting objects: 266, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (239/239), done.
Writing objects: 100% (266/266), 222.68 KiB, done.
Total 266 (delta 55), reused 0 (delta 0)

-----> Heroku receiving push
-----> Rails app detected
-----> Detected Rails is not set to serve static_assets
       Installing rails3_serve_static_assets... done
-----> Gemfile detected, running Bundler version 1.0.3
       Unresolved dependencies detected; Installing...
       Using --without development:test
       You have modified your Gemfile in development but did not check
       the resulting snapshot (Gemfile.lock) into version control

       You have deleted from the Gemfile:
       * version: 1.0.6
 !     Heroku push rejected, failed to install gems via Bundler

error: hooks/pre-receive exited with error code 1
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to ''

I tried adding Gemfile and Gemfile.lock to git but to no avail. I tried removing .bundle directory and Gemfile.lock but the same error.

  • How to deploy to Heroku with a different Gemfile / BUNDLE_GEMFILE
  • Bundler for javascript, or how to source control external javascript files
  • 'fatal error' during bundle install in ruby on rails
  • rails3 + bundler + git problem
  • How to organize development of Rails App and multiple Engines
  • What's different about the git hook environment? (Running Middleman in a post-receive hook)
  • GitIgnore - Ignoring bin/ but including bin/*.refresh
  • how to send somebody my (already generated) github public rsa key(send the key or the .pub file?)
  • Is is possible to git branch from master while on a different branch?
  • Can you get a word-diff with `git log`?
  • How to omit very long lines from `git grep`?
  • How should gitflow hotfixes work?
  • 6 Solutions collect form web for “Gemfile.lock not checked in – Heroku”

    There is a problem with bundler version 1.0.6
    You need to run “gem update bundler” on your development machine to update bundler to 1.0.7. Then you need to run bundle update in your app to generate a new Gemfile.lock file. You will see that the Gemfile.lock is updated. Commit this new Gemfile.lock and push to heroku again.

    I fixed mine by opening Gemfile.lock and deleting the following two lines:


    So now i just need to make a script that bundles then removes that from the lock file.

    Both the Gemfile and Gemfile.lock files needs to be included in the git repository.
    Make sure you are not ignoring them in the .gitignore file.

    Also, make sure you are using Bundler >= 1.0.0 on your local machine to generate the Gemfile.lock. I you use an outdated version, such as Bundler 0.9x, it will fail.

    Last but not least, update your Gemfile.lock if you have one.

    $ cd /path/to/project
    $ bundle update

    I deleted the “mingw” line under PLATFORMS on my Gemfile.lock file, added and committed to git, pushed it to git, then pushed everything to heroku and apparently it works now.

    In your applicaton directory, in the bin subdirectory modify the files


    Instead of

    '#!/usr/bin/env ruby.exe

    must be

    '#!/usr/bin/env ruby

    (thanks to previous post)

    Make sure there are no references to windows in the gemfile.lock – they can just be deleted.


    git push heroku master

    If there are still problems use heroku logs (copying text to a text editor makes it easier to cut and paste for solutions).

    Git Baby is a git and github fan, let's start git clone.