Himel
Himel

Reputation: 67

Unable to compile Ruby with OpenSSL

My system contains OpenSSL but Ruby is unable to require it. I was told that I must have installed Ruby before I had openssl in my system and that I have to rebuild ruby. So I went to the Ruby directory and typed.

pushd ext/openssl
sudo ruby extconf.rb
make
make install
popd

And then I was going to reconfigure Ruby by typing:

./configure
make 
make install

The problem is that after I run the extconf.rb file which works fine and I type sudo make, it gives this error message.

make: *** No rule to make target `/include/ruby.h', needed by `ossl_digest.o'.  Stop.

I don't know what that means or how to fix it. Please help!

Screenshot:

As you can see that only happens when it enters openssl. It can't read openssl for some reason.

Upvotes: 3

Views: 3651

Answers (2)

Richard Peck
Richard Peck

Reputation: 76784

Add this to your Makefile in ../ext/openssl (after using ruby extconf.rb):

top_srcdir = ../..

enter image description here

You then should be able to use make and make install without issue

Upvotes: 13

Robert Klemme
Robert Klemme

Reputation: 2179

You need libssl-dev if you want to compile Ruby from source.

Upvotes: 2

Related Questions