Bundler: can't find gem bundler (>= 0.a) with executable bundle (Gem::GemNotFoundException) during bundle install with gem

前端 未结 9 1974
再見小時候
再見小時候 2020-12-13 05:35

I\'m executing the following script:

gem install rdoc --no-document
gem install bundle
bundle

output:

+ gem install rdoc --         


        
9条回答
  •  [愿得一人]
    2020-12-13 05:52

    Bundler version 2 introduced a new feature to automatically use the version of Bundler specified in the Gemfile.lock of your project. Thus, if you have an existing Gemfile.lock with a line like this at the bottom

    BUNDLED WITH
       1.17.3
    

    Bundler will try to run with a Bundler version < 2.0. Since you just have Bundler 2.0.1 (and Rubygems >= 2.7.0) installed, this fails with this rather unhelpful error message.

    To fix this, you could

    • remove the lines from your Gemfile.lock and to use bundler 2.x everywhere from now on, or
    • install a bundler 1.x version with gem install bundler -v '< 2.0' to use the appropriate version as specified by your Gemfile.lock.

    More information about this can be found on the Bundler blog.

提交回复
热议问题