本文介绍了如何为每个开发人员自定义Gemfile?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有一个常见的模式:

有许多开发人员在一个项目上工作,并且Gemfile(.lock)通过SCM共享。但是,如果某些开发人员想要使用不同的工具进行测试和开发怎么办?

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?

问题是,当您将条件部分放入Gemfile中时,每个开发人员的Gemfile.lock也将有所不同,因此您会

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?

推荐答案

我想 install_if 方法(最近添加)解决了这个问题:

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

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

请参见

这篇关于如何为每个开发人员自定义Gemfile?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-18 19:24