I'm looking for a way to set up my rails app/Gem file to conditionally include a gem based on if I am in linux or not. I need the app in Linux, but it is not compatible with windows and I don't need it there anyway.
I was able to get everything working on Linux, but since I am using LESS stylesheets, I needed a javascript runtime. I didn't want to install Node.js, so i installed therubyracer, which is now in my gemfile. Then I pushed everything to github and cloned the app on my windows computer.
I tried to install all of the gems and realized there was no way install therubyracer on windows because of an incompatibility they haven't fixed yet (see therubyracer gem on windows)
I read elsewhere that I don't need therubyracer on windows because rails will automatically pick up the JScript runtime, so I'd like to have a simple way to only include therubyracer in linux. I read in does using ":platforms =>" in your gemfile work? that I can use an if block in my gemfile, but that it will cause my gemfile.lock to be regenerated every time. That was over a year ago though. Is there a way to only include therubyracer without regenerating gemfile.lock every time? Or maybe is gemfile.lock ok to remove my git and just have it generated every time locally?