Browse files

Merge pull request #11 from Sirupsen/os-specific-gems

OS-specific gems
  • Loading branch information...
2 parents 28928a9 + eb3520e commit b55ae167baa3d9b570bfa5c71091680966c5a194 @bbatsov bbatsov committed Oct 22, 2011
Showing with 26 additions and 2 deletions.
  1. +26 −2
@@ -389,10 +389,34 @@ the same purpose of the named scope and returns and
## Bundler
* Put gems used only for development or testing in the appropriate group in the Gemfile.
-* Avoid OS specific gems. Bundler has no facilities to deal with those properly.
* Use only established gems in your projects. If you're contemplating
on including some little-known gem you should do a careful review of
-its source code first.
+its source code first.
+* OS-specific gems will by default result in a constantly changing `Gemfile.lock`
+for projects with multiple developers using different operating systems.
+Add all OS X specific gems to a `darwin` group in the Gemfile, and all Linux
+specific gems to a `linux` group:
+ ```Ruby
+ # Gemfile
+ group :darwin do
+ gem 'rb-fsevent'
+ gem 'growl'
+ end
+ group :linux do
+ gem 'rb-inotify'
+ end
+ ```
+To require the appropriate gems in the right environment, add the
+following to `config/application.rb`:
+ ```Ruby
+ platform = RUBY_PLATFORM.match(/(linux|darwin)/)[0].to_sym
+ Bundler.require(platform)
+ ```
* Do not remove the `Gemfile.lock` from version control. This is not
some randomly generated file - it makes sure that all of your team
members get the same gem versions when they do a `bundle install`.

0 comments on commit b55ae16

Please sign in to comment.