Rails Bundle - 一颗宝石两个版本
我有旧的 Rails 应用程序。并且这个应用程序需要不同版本的相同 gem。
例如,它现在使用
gem 'actionmailer' 2.3.5 和 'actionmailer' 2.3.2 gem 'actionpack', '2.3.5' 和 'actionpack', '2.3.2'
不要问我为什么 =) 这是旧应用程序,而且非常庞大。当前的 Rails 版本 2.3.5
现在我尝试使用 Bunler 进行 Gems 控制。但 Bundler 不允许在配置中使用同一个 gem 两次。或者我可以看到这样的错误:
Bundler 找不到 gem“actionpack”的兼容版本:在 宝石文件: datanoise-actionwebservice (= 2.3.2) ruby 依赖于 动作包(= 2.3.2)红宝石
rails (= 2.3.5) ruby 依赖于 动作包 (2.3.5)
那么,我是否可以解决这个问题并且我不能使用 Bundler?
I have old rails application. And this application need the same gem with different versions.
For example, it use now
gem 'actionmailer' 2.3.5 and 'actionmailer' 2.3.2
gem 'actionpack', '2.3.5' and 'actionpack', '2.3.2'
Dont ask me why =) This is old app and very massive. Current rails version 2.3.5
Now i try to use bundler for my gems control. But Bundler can`t allows use one gem twice in config. Or i can see error like this:
Bundler could not find compatible versions for gem "actionpack": In
Gemfile:
datanoise-actionwebservice (= 2.3.2) ruby depends on
actionpack (= 2.3.2) rubyrails (= 2.3.5) ruby depends on actionpack (2.3.5)
So, can i solve this problem or not and i can`t use Bundler?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不可以,您必须将
datanoise-actionwebservice
升级到版本 2.3.5,或将rails
降级到 2.3.2。如果可能的话,我建议升级
datanoise-actionwebservice
。No, you must either upgrade your
datanoise-actionwebservice
to version 2.3.5, or downgrade yourrails
to 2.3.2.I suggest upgrading the
datanoise-actionwebservice
if possible.datanoise-actionwebservice 似乎对其 gemspec 中的 actionpack 和 activerecord 版本有非常(可能太)限制。但是我看到它在内部尝试使用 '>= 2.3.0' 版本加载这些 gem(请参阅 lib/action_web_service.rb)。
我建议尝试分叉这个 gem 并修补它的 gemspec,因此 actionpack 和 activerecord 的版本要求更改为 '>= 2.3.2'。
然后更新项目的 Gemfile 以使用修补版本:
希望它也适用于 2.3.5。
datanoise-actionwebservice seems to be very (probably too) restrictive about actionpack and activerecord versions in it's gemspec. However I see that internally it tries to load these gems with '>= 2.3.0' versions (see lib/action_web_service.rb).
I'd suggest trying forking this gem and patching it's gemspec, so the version requirements for actionpack and activerecord are changed to '>= 2.3.2'.
Then update your project's Gemfile to use the patched version:
Hopefully it will work with 2.3.5 as well.