I\'m developing a Rails app on a Mac, and I\'m new to testing, so I just added these gems to my Gemfile:
group :test, :development do
gem
You can use :install_if method which accepts arbitrary lambda.
Following example comes directly from Gemfile's man pages:
install_if -> { RUBY_PLATFORM =~ /darwin/ } do
gem "pasteboard"
end
It is much better than control flow constructs (e.g. if) as it maintains dependencies correctly and keeps Gemfile.lock uniform on all machines.