-1

I am trying to compile Ruby form source code on my Fedora 16 system.

These are the steps I followed:

  1. Compile the source code and install to my home directory: /home/gongzhen/program/ruby. When I run ruby -v I got:

    ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]
    
  2. Download "rubygems-2.0.3.zip" and unzip it. Running ruby setup.rb I got:

    RubyGems 2.0.3 installed
    /home/gongzhen/program/rubygems-2.0.3/lib/rubygems/core_ext/kernel_require.rb:45:in `require': cannot load such file -- openssl (LoadError)
    

It tells me that openssl cannot be loaded.

Does anyone know how to build Ruby through source code? I think the version of Ruby is the latest, but it needs some dependency files which I do not have.

I tried to run openssl version and got the information below:

OpenSSL 1.0.0e-fips 6 Sep 2011

It means openssl was installed on my system.

2
  • Ruby v2.0 includes RubyGems so you don't need to reinstall it. Run gem update --system to update RubyGems. May 26, 2013 at 3:12
  • Actually, when I run command $ruby install rails. The output is:ERROR: Loading command: update (LoadError) no such file to load -- openssl ERROR: While executing gem ... (NoMethodError) undefined method 'invoke_with_build_args' for nil:nilClass. I still think it is the openssl problem. DO I need to integrate the openssl with ruby? How May 26, 2013 at 19:48

1 Answer 1

1

Do you have openssl-devel installed? After that's installed, you need to build the OpenSSL extension in ruby:

cd <source-dir>/ext/openssl
ruby extconf.rb
make
make install

<source-dir> is where ever you have the ruby source code on your filesystem.

1
  • I went to the home/gongzhen/program/ruby-2.0.0-p195/ext/openssl and I run the command ruby extconf.rb. The output is just like:checking for t_open() int -lnsl...no\n checking for socket() in -lsocket ....no\n checking for assert.h ...yes\n checking for openssl/ssl.h ...no\n. And I run $make. I got: make:Nothing to be done for "all". It seems like I already installed. May 26, 2013 at 19:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.