I am working with a team of developers, and we are all using the same Gemfile from our repository. Because I am working on a Mac, and others are using Ubuntu, we have a Gemfile.local.example file in our repository as well that has the appropriate notification gems for each OS, all commented out.
I un-commented the gems for my OS and saved as a new file, not in version control, Gemfile.local. Now I would like "bundle install" to install gems from both files.
I can't find any good documentation on doing this.
There are several ways to specify gem versions: Use a specific version: gem "name-of-gem", "1.0" . You can find specific versions on Rubygems.org (provided that's the source you”re using) by searching for your gem and looking at the “Versions” listed. Use a version operator: gem "name-of-gem", ">1.0" .
A Gemfile is a file that is created to describe the gem dependencies required to run a Ruby program. A Gemfile should always be placed in the root of the project directory.
bundle exec allows us to run an executable script in the specific context of the project's bundle. Upon running the above command, bundle exec will run the executable script for rake version specified in project's Gemfile thus avoiding any conflicts with other versions of rake installed system-wide.
Why not just have one Gemfile
and use things like groups or use the :platform flag to only install some gems on OS X and others on Ubuntu?
Seems pretty unwieldy to have two Gemfiles. You can supply the Gemfile to use to bundle config
(man page) if you really want to do that, I guess.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With