1

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?

1

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 :)

  • 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. – A.S. Mar 1 '13 at 14:32
  • In addition to this, I had to configure openssl with the special darwin flag e.g. ./Configure darwin64-x86_64-cc when installing openssl. Otherwise it didn't provide libraries for ruby to install with (or possibly just put them in a weird location) – AlexMA Feb 21 '15 at 18:23
2

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.

  • I dislike using rvm and homebrew, further I never had any problems building a previous ruby version from source. – A.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. – docwhat Feb 25 '14 at 23:41
0

You need to change the code page of the current terminal window running this code:

chcp 1252
  • Welcome to Ask Different. We like answers to be more than just a single line. Ideally, you want to explain why your answer is *right." It also helps to provide links, citations, and/or screen shots. Please review our help section How to Answer on writing good answers to questions – Allan Aug 17 '17 at 12:05

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .