2个宝石需要不同版本的相同依赖 [英] 2 gems need different versions of the same dependency

查看:70
本文介绍了2个宝石需要不同版本的相同依赖的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有2个需要2个不同版本的gem同样的宝石依赖。两个版本的依赖gem都安装在我的系统上,但我仍然从Rails得到一个错误:Bundler找不到兼容版本的gem XXX。



什么是最好的做法来处理这样的情况?

解决方案

我会去做@BaroqueBobcat建议的。我只想补充一点 - 如果你需要最新的Twitter Gem,不能等待Groupon2的维护人员更新他的宝石 - 你可以在GitHub上分发Groupon2,更新它的gemspec,通过运行它的测试来看它是否仍然有效(并尝试修复它,如果它不),并包括你自己的版本使用其Git URL在你的Gemfile中像这样:gemgroupon2,::git =>https://github.com/yourgithubuser/groupon2.git 。



如果您想要保持良好状态,可以向Groupon2的维护人员提供您的更改,并提供奖励积分的请求:


Using Rails 3, I'm trying to figure out what I think should be pretty straightforward...

I have 2 gems that require 2 different versions of the same gem dependency. Both versions of the dependent gem are installed on my system but I still get an error from Rails: "Bundler could not find compatible versions for gem XXX".

What is the best practice to handle a scenario like this?

解决方案

I'd go for what @BaroqueBobcat suggests. I just want to add that - if you need the latest Twitter gem and can't wait for the maintainer of Groupon2 to update his gem - you can fork the Groupon2 on GitHub, update its gemspec, see if it still works by running its tests (and try to fix it if it doesn't) and include your own version using its Git URL in your Gemfile like so: gem "groupon2", :git => "https://github.com/yourgithubuser/groupon2.git".

If you want to be nice you can offer your changes to the maintainer of Groupon2 with a pull request for bonus points :)

这篇关于2个宝石需要不同版本的相同依赖的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆