本文介绍了捆绑安装找不到与宝石“ bundler”兼容的版本。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我键入捆绑安装时,出现此错误。我试图找到解决方案,但没有任何解决方案。请帮助我。

When I type bundle install I got this error. I tried to find solution but nothing solve my case. Please help me.

 Bundler could not find compatible versions for gem "bundler":
      In Gemfile:
        rails (= 4.1.8) was resolved to 4.1.8, which depends on
          bundler (< 2.0, >= 1.3.0)

      Current Bundler version:
        bundler (2.0.1)
    This Gemfile requires a different version of Bundler.
    Perhaps you need to update Bundler by running `gem install bundler`?

    Could not find gem 'bundler (< 2.0, >= 1.3.0)', which is required by gem 'rails
    (= 4.1.8)', in any of the sources.

    Bundler could not find compatible versions for gem "rails":
      In Gemfile:
        rails (= 4.1.8)

        animate-rails was resolved to 1.0.10, which depends on
          rails


推荐答案

您的捆绑器宝石太大。您现在可以通过更改gemfile来指定较低版本,然后再次删除锁定文件来降级。

Your bundler gem is too big. You can downgrade for now by changing your gemfile to specify the lower version, and deleting the lock file again.

gem 'bundler', '1.17.1'

然后在终端中尝试以下命令

Then try these commands in the terminal

gem install bundler -v 1.17.1
gem uninstall bundler -v 2.0.1
bundle update --bundler
bundle install

最后一个安装命令可能是多余的。我在用手机打电话,所以我无法测试任何东西。

That last install command might be redundant. I'm on my phone so I can't test anything unfortunately.

祝您好运!

编辑:

这是Heroku问题。得到它了。关于Bundler的Heroku文档

This is now a Heroku issue. Got it. Heroku docs regarding Bundler

在其Gemfile中指定Bundler 2.x的应用程序。锁将收到捆绑软件:2.0.1
在Gemfile.lock中指定捆绑软件1.x的应用程序将收到捆绑软件:1.15.2
在Gemfile.lock中没有BUNDLED WITH的应用程序将默认为捆绑软件:1.15 .2
有关可用设置的更多信息,请参见捆绑程序配置。有关为什么我们仅支持特定版本的捆绑软件版本的更多信息,请参见有关您的捆绑软件版本的文章。

Applications specifying Bundler 2.x in their Gemfile.lock will receive bundler: 2.0.1Applications specifying Bundler 1.x in their Gemfile.lock will receive bundler: 1.15.2Applications with no BUNDLED WITH in their Gemfile.lock will default to bundler: 1.15.2For more information on available settings see Bundler configuration. For more information on why we only support a specific set of bundler versions, please see this article about your Bundler version.

所以仅允许某些版本的Bundler兼容,相关文档已链接。降级到1.15.2,再给它一个机会。

So it seems like Heroku only allows certain versions of Bundler to be compatible, relevant doc is linked. Downgrade to 1.15.2 and give it another shot.

这篇关于捆绑安装找不到与宝石“ bundler”兼容的版本。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 07:34