4

Looking at my Gemfile.lock, I found a gem specified with a windows version. That is because I develop under a windows environment (I know. What can I say ?). Unfortunately, I use heroku, which is linux environment. This cause the app to crash.

I found a workaround : deleting the Gemfile.lock and then committing and pushing.

But this solution is not great right ? I mean, it's like fixing a wind shield with duct tape.

I was wondering if you guys have found a solution more elegant for this environment problem, that will not force me to manipulate files.

In advance, thanks.

Marcel Falliere
  • 1,884
  • 21
  • 39
  • A similar question came up a couple of months back but I don't think there was a satisfactory answer yet: http://stackoverflow.com/questions/3642085/make-bundler-use-different-gems-for-different-platforms – Steve Nov 05 '10 at 09:47
  • And what if I git ignore Gemfile.lock ? Would that work ? – Marcel Falliere Nov 05 '10 at 10:19

2 Answers2

1

Gemfile.lock should be in source control and I guess you're seeing herokus warning that Gemfile.lock will soon be required. What do you do then?

It's not all pitch black, I have collaborators as unfortunate as you, being stuck on windows ;) Some use linux, others Mac. Our Gemfile.lock looks like this

GEM
  remote: http://rubygems.org/
  specs:
    ...
    sqlite3-ruby (1.3.1)
    sqlite3-ruby (1.3.1-x86-mingw32)

On the other hand, heroku will ignore sqlite3, so this might not be the best example. What type of gem are you struggling with?

I suggest you try manually inserting the gem with the x86, like in the above example. Hope this helps...

oma
  • 38,642
  • 11
  • 71
  • 99
0

Actually the solution is to add the line

Gemfile.lock

to .gitignore

Marcel Falliere
  • 1,884
  • 21
  • 39