Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm having an issue with an uncooperative EC2 Ubuntu 10.04 4 LTS instance. I'm trying to install a few prerequisites for a Ruby web app which has the following dependencies:

require 'rubygems'
require 'webrick/https'
require 'OpenSSL'
require 'Plist'
require 'uuidtools'
require 'uri'
require 'net/http'
require 'net/https'
require 'net/protocol'
require 'json'
require 'htmldiff'

I have no issue installing uuidtools, uri, json, htmldiff or plist, however, when I try to run the server.rb app I receive this error:

/home/ubuntu/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require': cannot load such file -- OpenSSL (LoadError)
    from /home/ubuntu/.rvm/rubies/ruby-1.9.3-p125/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from server.rb:4:in `<main>'

I have the Ubuntu repository default 1.8 as well as 1.9.3p125 (which was installed via rvm). For each version I have the appropriate headers/dev packages installed. I've tried removing 1.8 and reinstalling 1.9.3 as well as the openssl library with no luck - I still receive the same message.

share|improve this question

If you didn't have the openssl-devel installed when you did "rvm install", you may have to do "rvm reinstall". Something like:

rvm reinstall 1.9.3-p125

Basically, Ruby may not have compiled with OpenSSL the first time around.

share|improve this answer
Thanks cjc! Although that didn't work I did find the bug. OpenSSL (Windows) doesn't exist in gems but openssl (*nix) does. Corrected that and it ran without issue. I wrote a deploy script to make the modifications after the developer commits new code. Thanks for your help. – upbeat.linux Mar 5 '12 at 4:44

The OpenSSL dependency existed on the developers Windows environment

require 'OpenSSL'

while the code was meant to deploy on Linux where the requirement is openssl.

require 'openssl'

I made the switch and was able to connect.

share|improve this answer

Just execute the below set of commands:

sudo apt-get install libssl-dev

cd your_ruby_path/ext/openssl

ruby ruby extconf.rb


make install

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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