Cannot install Ruby versions < 2.4 because of openssl@1.1 dependency #1883
-
It seems the most recent change to ruby-build 20191002 homebrew formula to require openssl@1.1 breaks the install of Ruby versions that are < 2.4 (those require openssl 1.0.2q) So, for macOS users who install ruby-build via homebrew, they will get openssl@1.1 installed as well. If they then try to run
Yeah, I know older versions are EOL but they still get used in some environments. Seems like changing https://github.com/rbenv/ruby-build/blob/master/bin/ruby-build#L1023 to only check for |
Beta Was this translation helpful? Give feedback.
Replies: 52 comments
-
I understand this issue too. But I didn't know the maintenance policy of ruby-build formula on homebrew. I suggest you use |
Beta Was this translation helpful? Give feedback.
-
Since I helped move the 1.1 change along: The workaround for EOL Ruby versions (or any that won't build with 1.1) where you still want to use Homebrew is as follows: (FWIW, the Homebrew formula was updated to use 1.1 at the end of August, the recent change was just to start looking for that version) |
Beta Was this translation helpful? Give feedback.
-
Thanks! That will work and I am sure will be helpful for others who may land on this thread. |
Beta Was this translation helpful? Give feedback.
-
I ran into this bug when trying to install Ruby 2.3.8 using the ASDF version manager. I was getting the following error when running:
ERROR: Ruby install aborted due to missing extensions Following the example above, I changed the command to the following and the installation worked correctly:
|
Beta Was this translation helpful? Give feedback.
-
This is very helpful, but frankly this should not have been a breaking change. Adding logic, or at least some kind of user feedback, would have been trivial in this case. |
Beta Was this translation helpful? Give feedback.
-
Thanks for the explanation and solution. Even just a link to this issue would be a great help to anyone using rbenv to install a <2.4.0 on mac. Many people will be running into this problem, not all of them confident enough to google the right error message (rbenv is usually part of a "run this to setup the repo" list in project READMEs). |
Beta Was this translation helpful? Give feedback.
-
I've taken option 2 from my comment on the original PR and made a new PR (#1375) to stop looking for Homebrew openssl entirely so that the discussion can focus there about whether that's the approach |
Beta Was this translation helpful? Give feedback.
-
Hello, I still seem to have this error. I am trying to instal ruby 2.3.7. My mac has openssl version
Am I missing anything? The command I am trying to run is |
Beta Was this translation helpful? Give feedback.
-
@hardvain you probably don't need to pass the option at all. 2.3.7 I don't think will work with 1.1, and from the error it looks like you don't have anything in |
Beta Was this translation helpful? Give feedback.
-
Hi, I have the same error and tried with multiple options:
I have the error is:
When I want to install openssl
And I have openssl via homebrew:
Thanks a lot |
Beta Was this translation helpful? Give feedback.
-
@jyr There are multiple things wrong with what you are doing. First of all, you are using rvm, which is an entirely different tool for installing Ruby than this repo is (we are called "ruby-build", also known as "rbenv install"). Second, you clearly have OpenSSL 1.1 installed, and this whole thread is about Ruby 2.3 and lower not being compatible with OpenSSL 1.1. So your method of installation won't work until you install OpenSSL 1.0 on your system. To others: Homebrew-core has removed their brew install rbenv/tap/openssl@1.0
RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl@1.0)" rbenv install 2.3.8 |
Beta Was this translation helpful? Give feedback.
-
Thanks @mislav . One small tweak and it worked for me
|
Beta Was this translation helpful? Give feedback.
-
@sco11morgan I am executed your command but I am receiving: Error: No available formula with the name "openssl@1.0" . How you resolved it? |
Beta Was this translation helpful? Give feedback.
-
@12masta you have to install it first from the |
Beta Was this translation helpful? Give feedback.
-
I had a similar problem. After unfortunately doing "brew upgrade" I ended up with openssl 1.1.1 installed and a bunch of broken already-installed rubies. To fix those up, I installed openssl@1.0 from the tap as explained by @gfguthrie and @mislav , then, to fix them all, executed the following commands in ~/.rbenv/versions:
Before executing this, you might want to print a list of the files you're going to be working on:
|
Beta Was this translation helpful? Give feedback.
-
@bfreezy confirmed, thanks a ton. i was indeed using version 12 of the command line tools, and downgrading to version 11 fixes |
Beta Was this translation helpful? Give feedback.
-
I can also confirm as @bfreezy suggested that command line tools 12 was the issue for me when trying to install 2.1.10. Downgrading to 11.5. fixed install issues for me and I ran install with |
Beta Was this translation helpful? Give feedback.
-
hii , does this fix works for 2.2.3 as well ?? |
Beta Was this translation helpful? Give feedback.
-
rbenv install 2.1.10 Downloading openssl-1.0.2u.tar.gz... Installed openssl-1.0.2u to /Users/zhaofujun/.rbenv/versions/2.1.10 Downloading ruby-2.1.10.tar.bz2... WARNING: ruby-2.1.10 is past its end of life and is now unsupported. ruby-build: using readline from homebrew BUILD FAILED (Mac OS X 10.15.7 using ruby-build 20201005) Inspect or clean up the working tree at /var/folders/cq/xmw2hj4d499c6zrcs7w_4wtw0000gn/T/ruby-build.20201014151416.69550.lZuVCh Last 10 log lines: |
Beta Was this translation helpful? Give feedback.
-
I had an exactly same issue. When I ran
From the post by @bfreezy, I learned that the version of Command Line Tools should not be 12. (Thank you so much for the information!) In fact, this is what I had
Therefore, I downgraded my Commond Line Tools version to 11 by following this post and I confirmed the version is downgraded.
Now I expect that
It seems like there is an issue with
As you can see above, in my case, I already had the latest version installed, but it was not linked.
And tried |
Beta Was this translation helpful? Give feedback.
-
I was shown the same error. For me it turned out that RVM and RBENV were both installed. Uninstalled RVM and reentered the directory. Everything worked. |
Beta Was this translation helpful? Give feedback.
-
This isn't entirely germane to the current thread, but the same thing just happened to me — I said I ended up having to blow away all my rubies and install them again. Not a huge pain, but a pain nonetheless. I find it very surprising that something can happen miles away (in brew) and rbenv can be crippled in this way. |
Beta Was this translation helpful? Give feedback.
-
The biggest problem is the openssl 1.0 in M1 Apple. Trying install with
or
Final result: These open issues may also help:
So these commands aren't working too
or
|
Beta Was this translation helpful? Give feedback.
-
You're going to have to find your own solution for openssl 1.0 on Apple Silicon – they have no plans to backport building 1.0: openssl/openssl#12254 (comment) There's probably an unofficial backport somewhere. |
Beta Was this translation helpful? Give feedback.
-
Inspired by this solution the following worked for me: export optflags="-Wno-error=implicit-function-declaration"
rbenv install 2.1.2 Setting |
Beta Was this translation helpful? Give feedback.
-
I am installing 2.3.4 and it's showing me openssl error shown below. (I have macos 11.5.1 and xcode 12.0.5) |
Beta Was this translation helpful? Give feedback.
-
With Amazon Linux 2 on ARM/aarch you need to install openssl-devel. |
Beta Was this translation helpful? Give feedback.
-
Can confirm that
Also had Xcode 12 installed and if the above command didn't work, was going to downgrade to 11 to try again. It seems like people using Spoke too soon. After installation, running
Doing some searching it seems it's an issue with Finally, this worked 😃:
|
Beta Was this translation helpful? Give feedback.
-
With the help of your report I also succeeded in installing ruby2.3.
For installing ruby2.3, you need to install openssl 1.0.(ref)
|
Beta Was this translation helpful? Give feedback.
-
Hey, I had same issue and prepared a patched version brew Formula https://gist.github.com/hellysmile/f58a6e32656ac1101cf6a64d0674f2c8 with openssl 1.0.2 patch from https://github.com/lavabit/magma |
Beta Was this translation helpful? Give feedback.
Since I helped move the 1.1 change along:
The workaround for EOL Ruby versions (or any that won't build with 1.1) where you still want to use Homebrew is as follows:
brew install opensslRUBY_CONFIGURE_OPTS="--with-openssl-dir=/usr/local/opt/openssl" rbenv install 2.3.8Latest solution/workaround (March 2020): #1353 (comment)
(FWIW, the Homebrew formula was updated to use 1.1 at the end of August, the recent change was just to start looking for that version)