Rails:Bundle无法解析依赖关系

时间:2017-01-14 17:55:11

标签: ruby-on-rails ruby bundler omniauth ruby-on-rails-5

我正在使用各种omniauth宝石,在我添加PayPal后,运行bundlebundle update时出现此错误:

Bundler could not find compatible versions for gem "omniauth-oauth2":
  In Gemfile:
omniauth-dribbble (~> 0.0.1) x86-mingw32 was resolved to 0.0.1, which
depends on
      omniauth-oauth2 (~> 1.1) x86-mingw32

omniauth-dribbble (~> 0.0.1) x86-mingw32 was resolved to 0.0.1, which
depends on
      omniauth-oauth2 (~> 1.1) x86-mingw32

omniauth-facebook (~> 4.0) x86-mingw32 was resolved to 4.0.0, which depends
on
      omniauth-oauth2 (~> 1.2) x86-mingw32

omniauth-google-oauth2 (~> 0.4.1) x86-mingw32 was resolved to 0.4.1, which
depends on
      omniauth-oauth2 (>= 1.3.1) x86-mingw32

    omniauth-paypal (~> 1.2) x86-mingw32 was resolved to 1.2, which depends on
      omniauth-oauth2 (~> 1.1.0) x86-mingw32

有没有办法绕过这个并仍然使用Omniauth PayPal Gem?

修改

PayPal Gem与Google Omniauth解决方案存在冲突。我不能两个都有。为什么呢?

2 个答案:

答案 0 :(得分:1)

你不能同时拥有它们因为paypal依赖于omniauth 1.1而google-oath2依赖于omniauth 1.3。你应该等到paypal使用omniauth 1.3。

答案 1 :(得分:1)

首先确保您使用的是更新版本的gem和捆绑更新。如果这不起作用。

然后你可以分叉宝石。更改“omniauth-oauth2”的依赖项,并参考您的分叉宝石。这样两种宝石都会引用相同的依赖宝石。