Closed anderium closed 1 month ago
Toolchains can break in so many ways across various operating systems that even warning for common breakages becomes fractal. I'd consider this an upstream issue since Homebrew and brew doctor
can get you on the right track but it's outside the scope of what ruby-install does as a tool.
For what it's worth, macOS disk migrations from Intel are already in steep decline and will fall off. That said, you might consider filing an upstream warning enhancement request with Homebrew. It's preferable for Homebrew to warn about how to fix itself rather than every brew tool each doing their own take downstream.
I agree with @havenwood, and I would also add that simply having an Intel installation of Homebrew on an Apple Silicon Mac is not a sign that something is wrong. It is perfectly reasonable, and sometimes necessary, to have an Intel installation of Homebrew (which can also exist at the same time as an arm64 installation).
For example, if you're working on a legacy Ruby project that uses a Ruby version older than 2.6, and/or older versions of gems that don't work on arm64 (such as ffi < 1.15.2), then the only way to safely get the project running locally (aside from using Docker or something similar) is to have a proper Ruby dev environment using Rosetta.
Also, Homebrew already performs some of these checks. If your current environment is arm64
, but the only Homebrew installation is in /usr/local
, and if you run brew doctor
, Homebrew will print out this warning:
Warning: Your Homebrew's prefix is not /opt/homebrew.
Many of Homebrew's bottles (binary packages) can only be used with the default prefix.
Consider uninstalling Homebrew and reinstalling into the default prefix.
Valid points! Thanks for the answers
Description
After having migrated from an Intel mac to Apple Silicon I had kept my previous homebrew install. Trying to install ruby failed because one of the library dependencies.
Steps To Reproduce
Steps to reproduce the bug:
$ ruby-install ruby
Expected Behavior
Ruby can compile.ruby-install
warns the user that they have an emulated version of homebrew and that installing will likely fail. Directing the user to reinstall homebrew so that it runs natively. (E.g. https://blog.smittytone.net/2021/02/07/how-to-migrate-to-native-homebrew-on-an-m1-mac/)Actual Behavior
Ruby does not compile for possibly multiple reasons:
closure.c
. This can be fixed by exporting the env vars thatbrew info libffi
gives.Environment
Solution
Reinstall homebrew natively by following the intructions here: https://brew.sh/#install. Recommended to also change
$PATH
and some other variables, see this blog post.