• 1
name Punditsdkoslkdosdkoskdo

OpenSSL installed, but Ruby unable to require it

I'm trying to setup github-pages on my Ubuntu laptop, and following the guide provided by Github I have to install the bundler package; giving the command

~$ gem install bundler

returns me this error.

ERROR: While executing gem ... (Gem::Exception) Unable to require openssl, install OpenSSL and rebuild ruby (preferred) or use non-HTTPS sources

Then I have installed OpenSSL, launched the command to update software and stuff and tried again to install bundler, but the error kept showing.

How can I fix this? Is there any specific command to rebuild ruby making it aware about the fact that openSSL is now installed?

I've found the answer to my own question, and I think it would be more clear to post as an answer, rather than editing the question.

1st try. Let's go through the path of non-safe source link.

As pointed out here, a possible choice to bypass the openSSL check is to remove the safe https link and add the non-safe one:

gem source -r
gem source -a

This way, the installation seems to go fine, but somewhere around the process openSSL is required again (for nokogiri gem, if I remember it well).

2nd try. Rebuild Ruby (it was so easy).

By the time I asked this question, my brain was probably not working properly. After installing openSSL by the usual way:

sudo apt-get install openssl

I got to my ruby directory and typed the following lines:

pushd ext/openssl
ruby extconf.rb
make install

This way, I had all dependencies issues and stuff solved (I guess). Then, running

make install

I've rebuilt Ruby and finally the installation went fine.

  • 0
Reply Report