可以强制版本的从属宝石?

时间:2021-08-27 00:19:51

I'm using two gems that depend on the faraday gem. Unfortunately, the depend on different versions...

我用的是两颗宝石都是用法拉第宝石做的。不幸的是,取决于不同的版本……

Bundler could not find compatible versions for gem "faraday":
  In Gemfile:
    vacuum (~> 0.2) depends on
      faraday (~> 0.7.6)

    sorcery depends on
      faraday (0.8.1)

Is there a way to force vacuum to use the version of faraday that sorcery depends on?

有没有一种方法可以强制真空使用魔法所依赖的法拉第版本?

1 个解决方案

#1


3  

The master branch depends on faraday 0.8.1. Point your Gemfile at the git repo for now, and urge the author to release an updated gem to rubygems.

主分支依赖于法拉第0.8.1。现在将Gemfile指向git repo,并敦促作者向rubygems发布更新的gem。

To answer your question for the case where the author hasn't updated, you'd have to fork the gem yourself, update the dependency in the gemspec, and use your forked version in your app.

对于作者没有更新的情况,要回答您的问题,您必须自己开发gem,在gemspec中更新依赖项,并在应用程序中使用分叉版本。

#1


3  

The master branch depends on faraday 0.8.1. Point your Gemfile at the git repo for now, and urge the author to release an updated gem to rubygems.

主分支依赖于法拉第0.8.1。现在将Gemfile指向git repo,并敦促作者向rubygems发布更新的gem。

To answer your question for the case where the author hasn't updated, you'd have to fork the gem yourself, update the dependency in the gemspec, and use your forked version in your app.

对于作者没有更新的情况,要回答您的问题,您必须自己开发gem,在gemspec中更新依赖项,并在应用程序中使用分叉版本。