I'm using Ubuntu Server 10, Ruby 1.9.2
When I try to require 'mongo'
it gives me this error:
irb(main):001:0> require 'mongo'
LoadError: no such file to load -- openssl
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/mongo-1.5.2/lib/mongo/util/ssl_socket.rb:1:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
from /usr/local/lib/ruby/gems/1.9.1/gems/mongo-1.5.2/lib/mongo.rb:63:in `<top (required)>'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `require'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:59:in `rescue in require'
from /usr/local/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:35:in `require'
from (irb):1
from /usr/local/bin/irb:12:in `<main>'
You need two things: OpenSSL itself and the ruby bindings for OpenSSL. The first part is as Yossi said:
sudo apt-get install libssl
The second depends on how you install ruby. I'm guessing from the paths in your question that you compiled ruby from source. In which case you first need to make sure you have then openssl headers:
sudo apt-get install libssl-dev
then it should be picked up automatically when you compile ruby. If you do not want to recompile ruby, the you should be able to build the OpenSSL bindings by
ruby extconf.rb
make && sudo make install
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With