Angel Garcia
Angel Garcia

Reputation: 1577

RVM can't install ruby-2.2.4 but can install other (newer) versions

I’m unable to install Ruby version 2.2.4 using RVM, however, 2.7.0 and 2.6.3 install file. I’ll note that when I run this command gem install bundler or gem update —-system, i get this error:

ERROR:  Loading command: update (LoadError)
    cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

And before this gets marked as a duplicate question, because there are a lot of answers solving this exact problem, they’re all answers posted before 2013 and are thus outdated. When I try running their solution, rvm gives me a warning that what I’m doing is considered deprecated use of RVM.

It’s also probably worth mentioning that when I try to install ruby 2.2.4, I get this error:

ruby-2.2.4 - #installing rubygems-3.0.8 - please wait
Error running 'env GEM_HOME=/Users/garcia/.rvm/gems/ruby-2.2.4@global GEM_PATH= /Users/garcia/.rvm/rubies/ruby-2.2.4/bin/ruby -d /Users/garcia/.rvm/src/rubygems-3.0.8/setup.rb --no-document',
please read /Users/garcia/.rvm/log/1583159172_ruby-2.2.4/rubygems.install.log

I already submitted an issue ticket on the RVM repo, but no one has responded in the last 3 days.

Any help is appreciated!

Upvotes: 3

Views: 2702

Answers (2)

E. Sambo
E. Sambo

Reputation: 921

Ruby version < 2.4 require the old and insecure OpenSSL 1.0 and is not compatible with OpenSSL 1.1. Check the links below on how to install it:

brew install rbenv/tap/[email protected]

gem install bundler -v '~>1'

Upvotes: 4

Kamal Panhwar
Kamal Panhwar

Reputation: 2399

Do you have openssl installed? please use following command to check it

openssl

There are some issue of compatibility between versions for different rubies. Ruby <2.4 is incompatible with OpenSSL 1.1 that mean you should have OpenSSL 1.0 you have to look in your folders for version 1 and check its folder and try following command where I have put option of --with-openssl-dir

rvm install ruby-2.2.4 --with-openssl-dir=/usr/local/Cellar/[email protected]/1.1.1d

In case you can't find openssl you can try this, but be caution as this openssl stuff is complicated and can effect other softwares too.

brew switch openssl 1.0.2s

Please check this url may help you to understand How to fix ruby openssl

Upvotes: 0

Related Questions