In my previous post, I set-up bundler with rails-2.2.2 application. Soon after that, I found myself in another trouble.
When I set-up bundler, I had to create Gemfile for the gems required by my rails application. Also, when I run bundle install command, it creates Gemfile.lock file, this file holds various information:
When I set-up bundler, I had to create Gemfile for the gems required by my rails application. Also, when I run bundle install command, it creates Gemfile.lock file, this file holds various information:
- Gem repositories (sources)
- Which version of gem the application is using (gem specification)
- If there is any dependency of any gem, then what they are
- Platform details
I wrote a ruby script to do this job for me. With this script, I removed everything windows specific in Gemfile and Gemfile.lock I can think of. Here is what I did (look at: https://github.com/gouravtiwari/windows_linux_fix_for_bundler for source code)
- I extended cruise:init rake task(created fix.rake in lib), to include my ruby script.
- In the script, I am removing windows traces, updating the platform details, running bundle command and then committing the latest Gemfile and Gemgfile.lock toSVN.
This way, if by mistake I am committing Gemfile and Gemfile.lock to SVN, I don't need to go to cruise and re-generate Gemfile and Gemfile.lock.