Ruby 2.2.2 build fail error on macOS 11.1 #1854
Replies: 30 comments 4 replies
-
@laynejohnson Having same issue with 2.3.3.Have you found any workaround yet. |
Beta Was this translation helpful? Give feedback.
-
@rahulpuroht Yes! It seems to have been an issue with XCode 12 (Apple changed the default |
Beta Was this translation helpful? Give feedback.
-
Having the same problem on Mac M1
:( |
Beta Was this translation helpful? Give feedback.
-
Hi there, Yes - also trying to get Ruby installed on Mac Silicone m1. What I've found so far... `Steves-MacBook-Air:~ steve$ arch -x86_64 /bin/bash -c 'CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.2.5' Installing ruby-2.2.5... WARNING: ruby-2.2.5 is past its end of life and is now unsupported. ruby-build: using readline from homebrew BUILD FAILED (macOS 11.1 using ruby-build 20201225) Inspect or clean up the working tree at /var/folders/4v/zps5vz_n3xjdmvq8pl_lf9780000gn/T/ruby-build.20210116112712.11791.4koc3o Last 10 log lines: Using: and I added: But as you see its not working. My next attempt followed this: https://stackoverflow.com/questions/64029645/rbenv-ruby-build-installs-fail-for-ruby-versions-1-9-3-2-2-0-2-2-5-with-xcod which suggests installing command line tools v11, and the setting that in Xcode preferences. However, on downloading the latest CLTs for v11 (11.5) - the installation says it is not compatible with m1 silicon. Has anyone got older Ruby with rbenv working on m1 yet? Or found any other steps forward? Many thanks, Steve. |
Beta Was this translation helpful? Give feedback.
-
There is no way to build the old ruby at M1 macOS with arm arch. |
Beta Was this translation helpful? Give feedback.
-
I'm sure there'll be a way - else there'll be a very upset group of devs not able to work on older ruby versions. |
Beta Was this translation helpful? Give feedback.
-
@stevenjohn Maybe, the old Rubies can work under the Rosseta2 environment. But I have only Apple DTK, I couldn't investigate macOS with M1 chip. |
Beta Was this translation helpful? Give feedback.
-
Cheers @hsbt - I've tried using
as a prefix which I believe uses Rosseta2 By using this I can see my installation went lot further than before - but I think the issue now is with the v12 command line tools, I'm seeing a lot of references to needing to use v11 - but not sure these can be installed on m1. |
Beta Was this translation helpful? Give feedback.
-
I know that this is a rbenv post. But I want to comment that I was able to install an old Ruby (2.3.8) on my M1 with Big Sur 11.1, running XCode 12.3 with RVM using the following commands:
|
Beta Was this translation helpful? Give feedback.
-
That's greatly appreciated - I will try it out and report back. |
Beta Was this translation helpful? Give feedback.
-
It isn’t exactly the same issue, but I wanted to share that the solution shared by @eveevans which set |
Beta Was this translation helpful? Give feedback.
-
Thank you @eveevans and @mrmanc the following worked for me: export optflags="-Wno-error=implicit-function-declaration"
rbenv install 2.1.2 |
Beta Was this translation helpful? Give feedback.
-
Is there a consensus here on whether 2.2.2 can indeed be built on M1 Silicon with ARM? I'm seeing the following error on install:
after trying #1700 (comment)
Are we just not able to build this version of ruby for ARM and have to use Rosetta? |
Beta Was this translation helpful? Give feedback.
-
@bradical in my case, I ended using Old rubies compiled with Rosseta 2, and the newest Rubies compiled for ARM. |
Beta Was this translation helpful? Give feedback.
-
Thanks @eveevans! This is interesting. It seems to have gotten pretty far and perhaps is just failing in some final symlinking step due to a badly named file
Full log attached |
Beta Was this translation helpful? Give feedback.
-
@ThomasKoppensteiner i saw you mentioned you got this working: #1700 (comment). Were you on M1 Silicon or Intel? @stevenjohn any luck on your end since: #1700 (comment)? I agree with you: #1700 (comment) that this is going to be a problem for devs (myself included) who are supporting/maintaining legacy apps. |
Beta Was this translation helpful? Give feedback.
-
@bradical I'm using a Intel Core i7. |
Beta Was this translation helpful? Give feedback.
-
thanks a lot, worked for me. |
Beta Was this translation helpful? Give feedback.
-
you are doing this in Rosetta terminal or normal? @eveevans |
Beta Was this translation helpful? Give feedback.
-
When I look into the log file, I get |
Beta Was this translation helpful? Give feedback.
-
@eveevans I am having issues installing it with openssl. Later when It requires openssl it gives me error saying reinstall using openssl |
Beta Was this translation helpful? Give feedback.
-
The following worked for me:
|
Beta Was this translation helpful? Give feedback.
-
is the bottom line that it's not possible to build 2.2.2 for arm64? |
Beta Was this translation helpful? Give feedback.
-
Hi @bradical - the above worked for me with 2.2.2 for arm64. For context, I'm on an M1 Macbook running Big Sur 11.5.2. |
Beta Was this translation helpful? Give feedback.
-
But if i'm understanding your code you're actually building for x86 using rosetta, no?
|
Beta Was this translation helpful? Give feedback.
-
Yes, you're right. It's the only way I could make it work, at least with the older Rubies. |
Beta Was this translation helpful? Give feedback.
-
On Ruby 2.6 I'm seeing $ file $(rbenv which ruby)
[...]/.rbenv/versions/2.6.5/bin/ruby: Mach-O 64-bit executable arm64 But then: $ ruby -e "puts RUBY_PLATFORM"
-darwin21 So the the "badly named file" ( |
Beta Was this translation helpful? Give feedback.
-
@crgc can you confirm the versions of readline and openssl that you have installed and also your macOS version and whether you installed them with x86_64 on homebrew or arm64? I'm trying your command #1700 (comment) but it's not working for me. |
Beta Was this translation helpful? Give feedback.
-
On my Mac M1 Pro, this alone worked |
Beta Was this translation helpful? Give feedback.
-
I know I'm a bit late to the party but this was still an issue for me. I noticed that my install would fail after printing
|
Beta Was this translation helpful? Give feedback.
-
Hello there! (And, Happy New Year!) I hope I am posting this in the right place! 🙏
I am trying to install Ruby 2.2.2 on macOS 11.1 for a project, but am running into the following error when running:
rbenv install 2.2.2
Error:
I have tried the workarounds in issue #1353 and have downloaded OpenSSL 1.0 on my system, but still no luck! Has anyone had a similar issue that they were able to resolve? Many thanks 🙏
UPDATE
Solution:
$ CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.2.2
#1489 (comment)
Beta Was this translation helpful? Give feedback.
All reactions