Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

OS-specific gems
  • Loading branch information...
commit b55ae167baa3d9b570bfa5c71091680966c5a194 2 parents 28928a9 + eb3520e
@bbatsov bbatsov authored
Showing with 26 additions and 2 deletions.
  1. +26 −2 README.md
View
28 README.md
@@ -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`.
Please sign in to comment.
Something went wrong with that request. Please try again.