Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

I can't install ruby from source, on configuration (./configure) it states

Ignore OpenSSL broken by Apple.
Please use another openssl. (e.g. using `configure --with-openssl-dir=/path/to/openssl')
Failed to configure openssl. It will not be installed.

Even if I use the told parameter. --with-opt-dir=/usr/local doesn't help either. Notice, I installed the latest openssl (1.0.1e) from source too (it's located at /usr/local/ssh).

So later I can't use gem install, it just states:

ERROR:  Loading command: install (LoadError)
    cannot load such file -- openssl
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass

How can I tell the ruby installation to take my installed openssl?

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

Had a similar issue on Tiger (yes, I'm using Ruby 2.0 on a Power Mac G4) – Ruby builds there just fine, but gem install rails fails with "RuntimeError: Unsupported digest algorithm (SHA512).".

Assuming you meant /usr/local/ssl and not /usr/local/ssh for the directory containing OpenSSL 1.0.1e, you should run ./configure as such:

./configure --prefix=/opt/ruby20 --with-openssl-dir=/usr/local/ssl

The configure script will say that --with-openssl-dir is an invalid option. It's lying. Add /opt/ruby20/bin (or whatever you set as your prefix) to your PATH and enjoy Ruby 2.0 :)

share|improve this answer
    
That worked, great! configure saying it is an invalid option really confused me, i never tried to build with that configuration. And yes i meant ssl - sorry for that. –  Adam S Mar 1 '13 at 14:32
add comment

Rather than doing all the building from sources (and having to hunt down any necessary patches) why not try using rvm to build (and manage) your rubies, and homebrew to allow you to build and install the necessary dependencies.

I have used these to get a ruby 2.0.0 build completed earlier today, although I haven't had a chance to check if it's fully functional yet.

share|improve this answer
    
+1 for using rvm –  revolver Feb 28 '13 at 1:23
    
I dislike using rvm and homebrew, further I never had any problems building a previous ruby version from source. –  Adam S Feb 28 '13 at 16:01
    
Adam S.: Apple is deprecating OpenSSL as of 10.7 which is part of the reason that it is broken. –  The Doctor What Feb 25 at 23:41
add comment

Your Answer

 
discard

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.