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

3 Answers 3

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

2
  • 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.
    – Appleshell
    Commented Mar 1, 2013 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
    Commented Feb 21, 2015 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.

2
  • I dislike using rvm and homebrew, further I never had any problems building a previous ruby version from source.
    – Appleshell
    Commented Feb 28, 2013 at 16:01
  • Adam S.: Apple is deprecating OpenSSL as of 10.7 which is part of the reason that it is broken.
    – docwhat
    Commented Feb 25, 2014 at 23:41
-1

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

chcp 1252
1
  • 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
    Commented Aug 17, 2017 at 12:05

You must log in to answer this question.

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