Permalink
Browse files

Add solution to the bundler platform Gem problem

  • Loading branch information...
1 parent 28928a9 commit eb3520eb451e56359181df9fef83ed72a19490f5 @sirupsen sirupsen committed Oct 21, 2011
Showing with 26 additions and 2 deletions.
  1. +26 −2 README.md
View
@@ -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 eb3520e

Please sign in to comment.