Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Gemfile.lock not checked in - Heroku

Tags:

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        FAILED: http://docs.heroku.com/bundler  !     Heroku push rejected, failed to install gems via Bundler  error: hooks/pre-receive exited with error code 1 To [email protected]:freezing-frost-65.git  ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to '[email protected]:freezing-frost-65.git' 

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.

like image 625
Ved Avatar asked Nov 23 '10 16:11

Ved


People also ask

Should Gemfile lock be checked in?

The Gem Development guide says that the Gemfile. lock file "should always be checked into version control." However, this is NOT true for Gems. For Applications, like your Rails apps, Sinatra apps, etc., it is true. The same does not go for Gems.

Is Gemfile lock automatically generated?

Gemfile. lock is automatically generated when you run bundle install or bundle update . It should never be edited manually.

What is the difference between Gemfile and Gemfile lock?

The Gemfile is where you specify which gems you want to use, and lets you specify which versions. The Gemfile. lock file is where Bundler records the exact versions that were installed. This way, when the same library/project is loaded on another machine, running bundle install will look at the Gemfile.


1 Answers

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.

like image 139
Aditya Sanghi Avatar answered Oct 07 '22 16:10

Aditya Sanghi