Jakub Jakub -4 years ago 78
Ruby Question

How to customize Gemfile per developer?

There is a common pattern:

there are many developers working on one project and the Gemfile(.lock) is shared via SCM. But what if some developers want to use different tools for testing and development? How to do it?

The problem is, that when you put conditional sections to your Gemfile, also the Gemfile.lock will be different for each developer and therefor you'll get conflict each time you commit to SCM.

Is there some simple, widely acknowledged solution?

Answer Source

I suppose the install_if method (added recently) solves the problem:

install_if -> { `whoami`.strip == 'jakub' } do
  gem "pry-rails"
end

See http://bundler.io/v1.14/man/gemfile.5.html#INSTALL_IF

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download