Rails Bundle, gems conflicts, best way to solve it

删除回忆录丶 提交于 2019-12-07 08:40:51

问题


I meet trouble using Bundle to resolve gems conflict.

can't activate builder (~> 2.1.2, runtime) for ["activemodel-3.0.8", "actionpack-3.0.8", "railties-3.0.8"], already activated builder-3.0.0 for ["cucumber-0.10.6"] (Gem::LoadError)

So that means active* are requiring builder v 2.1.2 when cucumber want the version 3.0.0. Easy, but ...

What i'm supposed to do with this ? Down grade cucumber ? I tried a bundle update but ... seams the last version of active model, pack and railties is 3.0.8. How could I know easily cucumber version compatible with active builder ?

Then, what is the general method to solve this kind of situation in general ?


回答1:


That's odd; Bundler should lock builder to v2.1.2 when examining dependencies.

First, try running bundle update to have Bundler re-resolve all your dependencies. This should correctly lock builder to v2.1.2.

Failing that, you can force builder v2.1.2 by adding it to your Gemfile:

gem `builder`, `~> 2.1.2'

Then run bundle update builder. This should add v2.1.2 to your Gemfile.lock, which should work fine with Cucumber (it only requires >= 2.1.2).

See Yehuda Katz's recent blog post on Gem versioning and Bundler for a bit more detail.



来源:https://stackoverflow.com/questions/6338344/rails-bundle-gems-conflicts-best-way-to-solve-it

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!