-
Notifications
You must be signed in to change notification settings - Fork 787
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
Error: "rm: illegal option -- a" installing ruby 2.2.2 on MacOS v11.2.3 Apple M1 Silicon #1742
Comments
Can confirm this happening when building ruby from source using:
which tells me this is not a ruby-build problem per se. Still, I have no other leads on this so if anyone has any ideas, that would be much appreciated. Feels like a problem with the |
At first, Ruby 2.2 is not supported M1 macOS and it's EOL today. I (also includes Ruby core team) have no plan to support it. |
I understand and I'd like to upgrade as soon as I can but I need to get this running first. Is there anything obvious in that make file in the final linking step that I could tweak to get this to work? This seems like a bad substitution or something as it ended up with a file called |
For anyone else interested this is how I got 2.2.10 to install on m1 mac: Firstly to get openssl1.0 installed you need a patched version that accounts for the arch (thanks @felixbuenemann): https://gist.github.com/felixbuenemann/5f4dcb30ebb3b86e1302e2ec305bac89#gistcomment-3567911 Try to install ruby 2.2.10 as per normal in rbenv:
After a while it'll fail as noted by @bradical with:
fyi @brandical I also wondered if the -darwin20-fake.rb was an error as usually it'd be something like x86_64-darwin20-fake.rb but I noticed this is just -darwin20-fake.rb with ruby 2.4 and works fine. Anyways, take a note the debug log directory and go to ruby directory in that path e.g.
I traced the error in
It's obviously running the command as if -darwin20-fake.rb are args to the rm command rather than a filename and failing (e.g. simplified it's trying to run There's most probably a better way to do this but for now it worked to just remove the rm -f part of the command:
$> make && make install voila working 2.2.10 ruby on m1 macs with rbenv. |
Thanks for posting this @kule! Looking forward to trying this out and will report back here. UPDATE: I was able to workaround the issue mentioned below by adding a UPDATE: Unfortunately, this didn't work for me but I got Ruby installed successfully as you did using the steps above. I'm now running into something that may be unrelated and—based on some Stack Overflow research—might be related to OpenSSL or zlib? Any time I try to install gems I get the following:
Steps to install:
The RUBYGEMS PLATFORMS below looks suspect:
|
@bradical I know this is going back some time, but curious if you found/remember a solution to your gem issue after modifying the |
@rygr I think I gave up. I need to go back and look. At some point, I'll either have to revisit it or upgrade the Ruby version and gems for this particular project. |
@kule thanks, your instructions worked. the process works if people need to install 2.0.0p648 I had the same error: I tried this:
which yielded this:
so I tried this to solve THAT:
but I still got this issue:
So after reading a bit I tried this command:
which in MY computer printed this (notice the ruby 2.7.3 stuff that should not have been there, notice also openssl3, which ruby 2.0.0 doesn't seem to like for some reason:
Notice there is a bunch of hardcoded stuff from previous attempts, and run this:
Luckily, this means progress, because now I get THIS error (a new error, I interpret as progress):
and now we see that the instructions provided by @kule are in fact correct, except in my case (2.0.0p648) the offending line was not in the same line number, obviously. I HAD to make sure this was installed and returned something that makes sense:
So finally I tried this:
notice how [email protected] seems to work here, as 1.0 was not available for me. I guess the issue is probably security, and that using old openssl versions is bad. I did get this warning:
So yeah, no more support, oof. So I run the program like this, and get the error:
and after getting the error, I try navigate to the config.status file. vi /var/folders/yv/lystpk8n2015cf8vmqd2yj_c0000gp/T/ruby-build.20220828013423.48747.PAu7Y1/ruby-2.0.0-p648/config.status your folder name may vary. then I proceed to do this, modify this line in line 1086 of config.status. Replaced:
With:
(this is why one uses rm -- in shell scripts, the use of -- is important I think. then make, and make install, and the binary is left here:
So I was lucky, I hope this helps others. So here is the history or part of it anyway:
let this be a lesson to all of us, we have to let the past go, and move on to a supported ruby 3, where the installation was easy and there wasn't problems. I wonder how can there be a way where the NEXT user doesn't have to deal with this, no idea how though. |
This solution worked for me, when installing ruby-2.0.0-p648, via ruby-install - in my apple silicon machine, when attempting to install via ruby-install the file causing the issue was Also, it is known that Ruby 2.3 and lower are not compatible with OpenSSL 1.1. So OpenSSL 1.0 may need to be used: #1883 (comment). To install openssl 1.0, you can use The steps were:
|
Steps:
[email protected]
via this formula: Update to OpenSSL 1.0.2u and add macOS arm64 (M1) build support homebrew-tap#2 (comment) as I couldn't get it build otherwiseexport RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix [email protected])"
CFLAGS="-Wno-error=implicit-function-declaration" rbenv install 2.2.2
as per Ruby 2.2.2 build fail error on macOS 11.1 #1700 (comment)It seems to fail at the very end with a strange error about an illegal option for
rm
:I thought this might be related to #1700 or #1691 but it seems a bit different than both so I filed separately.
ruby-build.20210331213055.45512.log
The text was updated successfully, but these errors were encountered: