rubyrbenvruby-2.0

error installing ruby old version 2.0.0-p247


I am trying to run command

 rbenv install 2.0.0-p247

I tried to follow several steps by googling the errors that I faced but I am still not able to resolve the error

I got this error

BUILD FAILED (macOS 11.4 using ruby-build 20210804)

Inspect or clean up the working tree at /var/folders/xm/rfncj90s56x8d1wdj0sl_0w40000gn/T/ruby-build.20210814020658.2987.F4rCnt
Results logged to /var/folders/xm/rfncj90s56x8d1wdj0sl_0w40000gn/T/ruby-build.20210814020658.2987.log

Last 10 log lines:
compiling ancdata.c
compiling raddrinfo.c
installing default socket libraries
compiling constants.c
1 warning generated.
linking shared-object ripper.bundle
ld: warning: directory not found for option '-L/Users/username/.rbenv/versions/2.0.0-p247/lib'
linking shared-object socket.bundle
ld: warning: directory not found for option '-L/Users/username/.rbenv/versions/2.0.0-p247/lib'
make: *** [build-ext] Error 2

The log file mentioned above has content:

https://easyupload.io/gygw5y


Solution

  • Ruby 2.0.0 is very much past its end of life, so I'm assuming you have a specific reason you need install it. Otherwise, you are much better off installing a modern, supported version such as 2.7.x or 3.0.x.

    Older versions of ruby were built with openssl@1.0. After 1.0 went end of life, ruby-build had a breaking change to require openssl@1.1. This means that ruby versions < 2.4 can no longer be installed/built directly using ruby-build (i.e., rbenv). This GitHub issue has details.

    Homebrew has removed its openssl@1.0 formula, but you can still install it via an rbenv tap. The following might work for you, though the comments in the issue report mixed results depending on the version of Command Line Tools being used.

    brew install rbenv/tap/openssl@1.0
    RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.0)" 2.0.0-p247
    

    Note: if you are running on an M1 (Apple Silicon) Mac, you might be out of luck. AFIK, there's no intention of getting openssl@1.0 to to work on Apple Silicon.