【问题标题】:Rails: Bundle cannot resolve dependenciesRails:捆绑无法解决依赖关系
【发布时间】:2017-05-29 22:03:37
【问题描述】:

我正在使用各种omniauth gems,在我添加PayPal后,我在运行bundle或bundle 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 解决方案发生冲突。我不能同时拥有它们。为什么?

【问题讨论】:

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


【解决方案1】:

首先确保您使用的是最新版本的 gems 和 bundle 更新。如果这不起作用。

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

【讨论】:

    【解决方案2】:

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

    【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2016-02-16
    • 2017-02-20
    • 1970-01-01
    • 2017-12-23
    相关资源
    最近更新 更多