rbenv install not downloading ruby version

Jerome

Installing ruby version with rbenv rbenv install -lreturns the proper list. However

$ rbenv install 2.3.4 -v

fails on the download, even though it can be downloaded via a browser. My hunch about an improper version of openssl (due to some distant memory of having such issues - tls version? - in the past) is supported in verbose mode:

ruby-build: use openssl from homebrew 
/var/folders/kV/kVDOSPkcEuqSVnTjenAVRE+++TI/-Tmp-/ruby-build.20170601122915.1010 ~ Downloading ruby-2.3.4.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.3/ruby-2.3.4.tar.bz2 
curl: (35)    error:1407742E:SSL routines:SSL23_GET_SERVER_HELLO:tlsv1 alert protocol version 
error: failed to download ruby-2.3.4.tar.bz2

how to overcome? can I point rbenv to use the downloaded tarball?

SkipIntro

The reason is because rbenv use old system curl and old system openssl with it, which knows nothing about protocols TLS v 1.1-1.3. For me, installing new version of curl and openssl with brew did the work:

brew install [email protected]
brew install curl

Then add installed curl to your PATH (before default path, which is /usr/bin), and ensure that openssl of actual brew's version is also there (add this to your ./bash_profile or ./zshrc or etc):

export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export PATH="/usr/local/opt/curl/bin:$PATH"

You can make sure after relaunch of terminal that latest versions of this programs will be used by trying

which -a openssl
which -a curl
openssl version -a
curl -V

First two commands should output all paths with the programs, but top ones should be brew versions. Last two commands should show latest versions of programs (1.1.0f and 7.55 for me now). Now try

rbenv install [version]

Works on MacOS Sierra with enabled SIP.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

Install Latest Stable Version of Ruby Using rbenv

Why can't rbenv install the latest Ruby version on Ubuntu?

rbenv not changing ruby version

rbenv working but ruby version not changing

Where does rbenv install ruby?

rbenv Ruby version 2.7.6 got ruby-build error and won't install

brew install rbenv Error: rbenv-rbenv already installed To install this version, first `brew unlink rbenv`

Rbenv vagrant global ruby version unchanged

rbenv can't change global ruby version

Vagrant provisioning - installing ruby version on rbenv fails

How to install ruby on Mac using rbenv?

How to install ruby-build for rbenv on Ubuntu?

rbenv install --list does not list version 2.1.2

Rbenv Version 2.1.1, but Error Says Ruby Version is 2.0.0

How to use specify version of ruby for shell script with rbenv?

Git post-receive hook not using ruby version specified by rbenv

Mavericks, RBENV, Your Ruby version is 2.0.0, but your Gemfile specified 2.1.1

rbenv Your Ruby version is 2.0.0, but your Gemfile specified 2.1.2

Capistrano rbenv - Ruby version not installed witn dry run

After installing ruby 2.2.3 with rbenv it has a different version

rbenv & ruby-build not showing the same list of version

Why cant I change my ruby version with rbenv?

How to install ruby system-wide using rbenv

Failed to install ruby 2.5.0 thru rbenv macOS High Sierra

Unable to install Ruby 2.4.0 using rbenv on Ubuntu 16.04 LTS

Unable to install Ruby 2.5.1 using rbenv, gives C Compiler error

Chef + rbenv: "rbenv: no such command 'install'" despite ruby-build being installed

I want to change ruby version by rbenv, but I can't reset my 'which ruby'

Ruby: How to install a specific version of a ruby gem?