2
votes

i'm getting a "no such file to load -- openssl" error when trying to open a page!

i've googled for hours now, and none of the solutions i found worked for me :(

i'm on OSX (10.6.6) running ruby 1.9.2p136 (installed via rvm(multiuser installation))

here is a list of my local gems:

*** LOCAL GEMS ***

abstract (1.0.0)  
actionmailer (3.0.4, 3.0.3)  
actionpack (3.0.4, 3.0.3)  
activemodel (3.0.4, 3.0.3)  
activerecord (3.0.4, 3.0.3)  
activeresource (3.0.4, 3.0.3)  
activesupport (3.0.4, 3.0.3)  
arel (2.0.8, 2.0.7, 2.0.4)  
bcrypt-ruby (2.1.4)  
builder (3.0.0, 2.1.2)  
bundler (1.0.10)  
devise (1.1.5, 1.1.4)  
erubis (2.6.6)  
haml (3.0.25)  
i18n (0.5.0, 0.4.2)  
mail (2.2.15, 2.2.10)  
mime-types (1.16)  
openssl-extensions (1.1.0)  
polyglot (0.3.1)  
rack (1.2.1)  
rack-mount (0.6.13)  
rack-test (0.5.7, 0.5.6)  
rails (3.0.4, 3.0.3)  
railties (3.0.4, 3.0.3)  
rake (0.8.7)  
sqlite3 (1.3.3)  
sqlite3-ruby (1.3.3, 1.3.2)  
thor (0.14.6)  
treetop (1.4.9)  
tzinfo (0.3.24, 0.3.23)  
warden (1.0.3)  

please help...i'm new to ruby on rails and totally lost at this point here :(

thx

matthias

Update:
I tried to recompile openssl by hand doing this (as root user):

cd /usr/local/rvm/src/ruby-1.9.2-p136/ext/openssl  
ruby extconf.rb  
make  
sudo make install  

but ruby extconf.rb outputted an error:

=== OpenSSL for Ruby configurator ===  
=== Checking for system dependent stuff... ===  
checking for t_open() in -lnsl... no  
checking for socket() in -lsocket... no  
checking for assert.h... yes  
=== Checking for required stuff... ===  
checking for openssl/ssl.h... no  
=== Checking for required stuff failed. ===  

Makefile wasn't created. Fix the errors above.

what can i do about it?

Update 2:
installed openssl via homebrew now:

brew install openssl  
sudo brew link openssl  

everything worked, no errors!

then did the following:

rvm remove 1.9.2
rvm install 1.9.2 --with-openssl-dir=/usr/local/etc

last one outputted this:

/usr/local/rvm/rubies/ruby-1.9.2-p136, this may take a while depending on your cpu(s)...

ruby-1.9.2-p136 - #fetching   
ruby-1.9.2-p136 - #extracting ruby-1.9.2-p136 to /usr/local/rvm/src/ruby-1.9.2-p136  
ruby-1.9.2-p136 - #extracted to /usr/local/rvm/src/ruby-1.9.2-p136  
ruby-1.9.2-p136 - #configuring  
ruby-1.9.2-p136 - #compiling  
Error running 'make ', please read /usr/local/rvm/log/ruby-1.9.2-p136/make.log  
There has been an error while running make. Halting the installation.  
root@MatthiasMacBookPro~$ Error running 'make ', please read /usr/local/rvm/log/ruby-1.9.2-p136/make.log  
Error: Only takes 0 or 1 arguments  

get the make.log here: http://matthias-ptx4s.posterous.com/private/kksnjfiJoB

Update 3:

when i switch via rvm to ruby 1.8.5 everthings just works. so why doesn't it when i switch to 1.9.2-head !?

Solution:

Openssl was somehow compiled for 32bit. i fixed it by deleting all openssl versions and reinstalling it with via mac ports:

sudo port install openssl +universal

mac ports install openssl at /opt/local by default so you need to add this path when installing ruby:

sudo rvm install 1.9.2 --with-openssl-dir=/opt/local

voila :)

1

1 Answers

1
votes

Removed my useless comment as Matthias has found the solution.