Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OS-specific gems #11

Merged
merged 1 commit into from Oct 22, 2011
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
28 changes: 26 additions & 2 deletions README.md
Expand Up @@ -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`.
Expand Down