Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why won't Heroku accept my Gemfile.lock in Windows?

I have a rails application that I deploy on Heroku. I'm using several different machines, and I noticed that when I add new dependencies (so that Gemfile.lock is rebuilt) and do bundle install on my Windows computer at home, push to Heroku fails with the following error:

   Unresolved dependencies detected; Installing...
   Windows Gemfile.lock detected, ignoring it.
   You have modified your Gemfile in development but did not check
   the resulting snapshot (Gemfile.lock) into version control
   ...

Gemfile.lock IS under version control, but Heroku appearently chooses to ignore it since it's created in Windows, and then complains that it's missing seconds later. Why does this happen? And how can I solve it?

like image 644
mranders Avatar asked May 10 '11 17:05

mranders


2 Answers

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

PLATFORMS
  x86-mingw32

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

like image 115
jeremy wentworth Avatar answered Oct 14 '22 08:10

jeremy wentworth


Like matt commented above:

The problem is that Bundler creates different Gemfile.locks for Windows. The only solution is to create and commit the lock file on a *NIX system.

I would suggest to create a virtual machine running e.g. Ubuntu – maybe using Virtual Box. You can even get ready-to-use virtual machines – for example here.

like image 26
Koraktor Avatar answered Oct 14 '22 08:10

Koraktor