Reputation: 303
Getting few errors while installing ruby-2.1.2 using rvm. I am new to ruby and hence need assistance. Please let me know
Installation log and other relevant information here: log
From the log provided in problem description, I have ruby 2.1.2 installed in the system. However, getting error when tried listing gems with gem list
due to installation errors.After changing to 2.1.2 i.e., rvm use 2.1.2
and executing ruby -r openssl -e 'puts OpensSSL::OPENSSL_VERSION'
gives this error:
/Users/praveenk.k/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- openssl (LoadError) from /Users/praveenk.k/.rvm/rubies/ruby-2.1.2/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in require'
Upvotes: 20
Views: 22676
Reputation: 19090
On Mac OS X Big Sur, to install Ruby 2.3.2 with RVM, the fix was
brew install rbenv/tap/[email protected]
CFLAGS="-Wno-error=implicit-function-declaration" rvm reinstall ruby-2.2.5 --with-openssl-dir='/usr/local/opt/[email protected]'
Reference was here -- https://github.com/rvm/rvm/issues/4889
Upvotes: 1
Reputation: 351
On mac BigSur, I fixed it via
$ rvm pkg install openssl
$ rvm install 2.1.2 -C --with-openssl-dir=$HOME/.rvm/usr
or you can also try with
$ rvm pkg install openssl
$ CFLAGS="-Wno-error=implicit-function-declaration" rvm install 2.1.2 -C --with-openssl-dir=$HOME/.rvm/usr
Upvotes: 8
Reputation: 460
For me solve this in centos 7
$ openssl version -a
OpenSSL 1.0.2k-fips 26 Jan 2017
built on: reproducible build, date unspecified
platform: linux-x86_64
options: bn(64,64) md2(int) rc4(8x,int) des(idx,cisc,16,int) idea(int) blowfish(idx)
compiler: gcc -I. -I.. -I../include -fPIC -DOPENSSL_PIC -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -DKRB5_MIT -m64 -DL_ENDIAN -Wall -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Wa,--noexecstack -DPURIFY -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DRC4_ASM -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM -DVPAES_ASM -DBSAES_ASM -DWHIRLPOOL_ASM -DGHASH_ASM -DECP_NISTZ256_ASM
------------------------------------------------------------------------
OPENSSLDIR: "/etc/pki/tls" <- ************* COPY THIS PATH *************
------------------------------------------------------------------------
engines: rdrand dynamic
paste the path in the bellow line how --with-openssl-dir param
$ RUBY_CONFIGURE_OPTS="--with-openssl-dir=/etc/pki/tls" rbenv install 2.7.2
Upvotes: 1
Reputation: 13929
On Amazon Linux 2, even if openssl is installed, you need the full dev kit
yum install openssl-devel
Upvotes: 0
Reputation: 2365
Worked example
brew install rbenv/tap/[email protected]
rvm install 2.1.2 -C --with-openssl-dir=`brew --prefix [email protected]`
It's from https://github.com/rvm/rvm/issues/4819#issuecomment-595644550
Upvotes: 28
Reputation: 717
Ruby <2.4 is incompatible with OpenSSL 1.1 (e.g see https://github.com/rbenv/ruby-build/issues/1353).
Just a hunch, but if you're using Mac + Homebrew, OpenSSL 1.0 was recently deleted, so anything along the lines of brew upgrade openssl
would trash that.
There are several options to deal with this:
asdf
installed with LibreSSL (which may be safer anyway, see https://security.stackexchange.com/questions/112545/what-are-the-main-advantages-of-using-libressl-in-favor-of-openssl):$ openssl
OpenSSL> version
LibreSSL 2.8.3
There might be something less convoluted than that; if someone has ideas, please feel free to comment or give an alternate answer.
EDIT
I personally ran into this issue with some other software and discovered that this fixed it, since the old SSL version was sitting around still:
brew switch openssl 1.0.2s
Should work so long as Homebrew doesn't "helpfully" clean that out for me.
Upvotes: 17