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
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'
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
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'
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)
gem sources --remove https://rubygems.org/
gem sources --remove http://rubygems.org/
gem sources -l
and the output show:
*** CURRENT SOURCES ***
http://rubygems.org/
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!!!
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
For those that arent using rvm, but are using homebrew:
brew tap raggi/ale
brew install openssl-osx-ca
This worked for me.