Error installing Bundler

后端 未结 13 950
感情败类
感情败类 2020-12-05 07:17

I am trying to install the Bundler gem on my Mac. With the command: sudo gem install bundler I get the following error:

ERROR:  Could not find a         


        
相关标签:
13条回答
  • 2020-12-05 07:30

    Bundler 2 requires at least Ruby 2.3.0 and RubyGems 2.5.0. You might get the following error when you try to install bundler for Ruby < 2.3:

    COPY

      ERROR:  Error installing bundler:
      bundler requires Ruby version >= 2.3.0.
    

    To fix this error upgrade your project's ruby version or install the last supported version of Bundler for Ruby < 2.3:

    COPY gem install bundler -v '~>1'

    0 讨论(0)
  • 2020-12-05 07:35

    Windows users:

    You can't run rvm command on Windows as you can see here, but you can fix the error without it. Just add a new source adress with http instead of https:

    gem sources -a http://rubygems.org
    

    Then you can run:

    gem install bundler
    
    0 讨论(0)
  • 2020-12-05 07:39

    Bundler 2 requires at least Ruby 2.3.0 and RubyGems 2.5.0.

    You might get the following error when you try to install bundler for Ruby < 2.3:

    ERROR:  Error installing bundler:
    bundler requires Ruby version >= 2.3.0.
    

    To fix this error upgrade your project's ruby version OR Install the last supported version of Bundler for Ruby < 2.3 by running only below command.

    gem install bundler -v '~>1'
    
    0 讨论(0)
  • 2020-12-05 07:42
    1. Here is my error when I input the command sudo gem install bundler --no-ri --no-rdoc.

    ERROR: Could not find a valid gem 'bundler' (>= 0), here is why: Unable to download data from https://rubygems.org/ - Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://api.rubygems.org/latest_specs.4.8.gz)

    1. And my solution is input the next command lines:

    gem sources --remove https://rubygems.org/

    gem sources --remove http://rubygems.org/

    gem sources -l

    and the output show:

    *** CURRENT SOURCES *** http://rubygems.org/

    1. Then, try sudo gem install bundler --no-ri --no-rdoc again:

    Fetching: bundler-1.11.2.gem (100%) Successfully installed bundler-1.11.2 1 gem installed

    Bingo!!!

    0 讨论(0)
  • 2020-12-05 07:45

    for those Chinese users:

    $ gem install bundler
    ERROR:  Could not find a valid gem 'bundler' (>= 0), here is why:
              Unable to download data from https://rubygems.org/ - Errno::ECONNRESET: Connection reset by peer - SSL_connect (https://api.rubygems.org/latest_specs.4.8.gz)
    
    $ gem sources --add https://ruby.taobao.org/ --remove https://rubygems.org/
    
    $ gem sources  -l
    *** CURRENT SOURCES ***
    
    https://ruby.taobao.org/
    
    $ gem install bundler 
    
    Fetching: bundler-1.12.5.gem (100%)
    Successfully installed bundler-1.12.5
    Parsing documentation for bundler-1.12.5
    Installing ri documentation for bundler-1.12.5
    Done installing documentation for bundler after 4 seconds
    1 gem installed
    

    My environment: rbenv, ruby 2.1.2, ubuntu 16.04 LTS

    0 讨论(0)
  • 2020-12-05 07:50

    For those that arent using rvm, but are using homebrew:

    brew tap raggi/ale
    brew install openssl-osx-ca
    

    This worked for me.

    0 讨论(0)
提交回复
热议问题