-
Notifications
You must be signed in to change notification settings - Fork 783
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot install Ruby versions < 2.4 because of openssl@1.1 dependency #1353
Comments
I understand this issue too. But I didn't know the maintenance policy of ruby-build formula on homebrew. I suggest you use |
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) |
Thanks! That will work and I am sure will be helpful for others who may land on this thread. |
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:
|
- `caskroom/cask` no longer needs to be tapped in newer versions of homebrew: https://stackoverflow.com/a/58337898 - Resolving openssl version conflict when installing ruby versions with rbenv: rbenv/ruby-build#1353 (comment)
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. |
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). |
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 |
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 |
@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 |
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 |
@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 |
Thanks @mislav . One small tweak and it worked for me
|
@sco11morgan I am executed your command but I am receiving: Error: No available formula with the name "openssl@1.0" . How you resolved it? |
@12masta you have to install it first from the |
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:
|
Is this still true? I am trying the solution with
|
@ryanwi Have you passed RUBY_CONFIGURE_OPTS?
|
@mislav Yes, that does work, thank you for providing that. I am able to install 2.3.8 with that fix. I'm curious though why a plain These work
These don't
|
@ryanwi maybe an issue with 10.15.3 or more likely whatever version of the command line tools you have? I have 10.15.1 & CLTools 11.2.0.0.1.1571444319 and the install for 2.3.8 completed normally. |
That's a good question, and I do not have any idea why that is currently happening for you, sorry. 😕 |
I have 10.15.3 with CLITools 11.3.1
|
For the record, I have the same issues as ryanwi with 2.3.3. Output and Xcode & clang version
|
AND does this work for ruby 1.9.3-p194 ??? |
I'm not sure why your installation was failed. At least, It's not an issue of rbenv and ruby-build. |
I am trying to install 2.3.3 and 2.3.4 as both needed in my project, but installation kept failing.
Normal installation also fails:
|
@mullermp Did you ever resolve your issue? I'm encountering a similar issue trying to install $ rbenv install 2.5.8
Downloading openssl-1.1.1g.tar.gz...
-> https://dqw8nmjcqpjn7.cloudfront.net/ddb04774f1e32f0c49751e21b67216ac87852ceb056b75209af2443400636d46
Installing openssl-1.1.1g...
Installed openssl-1.1.1g to /Users/paulpettengill/.rbenv/versions/2.5.8
Downloading ruby-2.5.8.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/2.5/ruby-2.5.8.tar.bz2
Installing ruby-2.5.8...
WARNING: ruby-2.5.8 is nearing its end of life.
It only receives critical security updates, no bug fixes.
ruby-build: using readline from homebrew
BUILD FAILED (Mac OS X 10.15.6 using ruby-build 20200819)
Inspect or clean up the working tree at /var/folders/f6/4bg8bgyd3z33ccrd3lc1gd140000gn/T/ruby-build.20200907135317.52026.of1dJh
Results logged to /var/folders/f6/4bg8bgyd3z33ccrd3lc1gd140000gn/T/ruby-build.20200907135317.52026.log
Last 10 log lines:
^
_Nonnull
193 warnings generated.
linking shared-object -test-/printf.bundle
193 warnings generated.
193 warnings generated.
linking shared-object -test-/proc.bundle
193 warnings generated.
linking shared-object date_core.bundle
make: *** [build-ext] Error 2 |
@prpetten I did resolve the issue but I was unsure how. I ended up nuking a lot of my installations and configurations and redoing it. |
@mullermp Thanks. For anyone else who comes across this, I ended up nuking Homebrew, X-Code with Dev Tools and re-installing everything, and it worked without issue. |
@mullermp i am getting the exact same errors as in your gist. i have very simple repro instructions in my gist. it's essentially:
i show that it fails (for me) with the same errors for rubies up to version 2.2.5, and works for ruby versions greater than or equal to 2.3.1. ultimately it gets 3 warnings and 4 errors, and the errors are these:
so unfortunately, nuking everything as @prpetten suggests is not doing it for me. note that my repro instructions do not mention installing openssl 1.0 from brew, but i also tried that approach as suggested above at #1353 (comment), and it also does not help. i'm using a 16" 2019 MacBook Pro, which I hope is irrelevant. If anyone has a mac/drive they don't mind wiping, i'd be very interested to know how common this issue is (and of course, what the solution might be). thanks for ruby-build; we'd all be hosed without it. |
@burnettk what version of Command Line Tools do you have installed? You can check by running I suspect you may have version 12, which was just released by Apple on 9/16/2020. I can replicate a similar error installing 2.2.5 but I don't have this error if I downgrade Command Line Tools to version 11. |
@bfreezy confirmed, thanks a ton. i was indeed using version 12 of the command line tools, and downgrading to version 11 fixes |
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 |
hii , does this fix works for 2.2.3 as well ?? |
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: |
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 |
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. |
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. |
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
|
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. |
Inspired by this solution the following worked for me: export optflags="-Wno-error=implicit-function-declaration"
rbenv install 2.1.2 Setting |
…d the differing versions of openssl between < 2.4 and >= 2.4 seems to be causing trouble when the matrix crosses this barrier. Potentially due to caching, and something that can be fixed, if we need to support 2.3, with extra scripting in our workflow to implement this solution: rbenv/ruby-build#1353 (comment)
With Amazon Linux 2 on ARM/aarch you need to install openssl-devel. |
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 😃:
|
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
rbenv install 2.1.10
for instance, it will fail with: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
openssl
and not `openssl@1.1 could potentially fix this?The text was updated successfully, but these errors were encountered: