-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Error installing grpc gem on M4 MacBook #39363
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
Comments
I'm having the same problem. Looks like it has something to do with Command Line Tools for Xcode 16.3, since downgrading to 16.2 fixes it. The workaround that works for me is:
|
@stefanwork Thank you, I also understood that Command Line Tools not compatible with As I see in I also tried some downgrade of the Command Line Tools to v15 but it did not work and I did not think that only one minor version will do the trick, thx again for sharing your way. After three nights of trying and asking Ai and searching google I ended up with coping this compiled gem from other MacBook and its finally worked earlier today. |
Or better yet, avoid having to compile from source at all by installing 1.70.1 onwards where the gems are precompiled for Ruby 3.4 and should install near instantly as long (as you’re not forcing use of ‘Ruby’ platform only) 1.69 predates Ruby 3.4 so by definition the gems are not precompiled. |
Any fix that needs to be made here is not going to be backported to 1.69.x anyway (from what I have seen of grpc releases, although I am not a maintainer) so you’re going to have to try with newer versions anyway. |
As a side note, why would you want to install x64 versions of gems via Rosetta if you have an Apple Silicon M4 macbook, rather than using aarch64 gems, or trying to compile for that platform at least? |
I found a workaround by installing an old version of the LLVM toolchain from homebrew (https://brew.sh/): $ brew install llvm@17
$ export PATH="$(brew --prefix llvm@17)/bin:$PATH"
$ export CC=clang
$ export CXX=clang++
$ export LDFLAGS="-L$(brew --prefix llvm@17)/lib"
$ export CPPFLAGS="-I$(brew --prefix llvm@17)/include"
$ gem install grpc --platform=ruby --version 1.69.0
Building native extensions. This could take a while...
Successfully installed grpc-1.69.0
Parsing documentation for grpc-1.69.0
Installing ri documentation for grpc-1.69.0
Done installing documentation for grpc after 8 seconds
1 gem installed |
@jasonpenny Hm, also tried these steps, didn't work for me. |
Here's what worked for us:
NotesNot sure if step 1 is necessary, I've done this to make sure there is no trace of the old toolchain left. Steps 2 and 3 are copied from #39363 (comment). Reinstalling Ruby (step 4) is necessary if you've built Ruby 3.4 using the newest Command Line Tools and you get errors like this after toolchain downgrade:
|
Version 1.72.0 was released today and it resolves this issue for me. |
Close as user verified fixed in 1.72.0 |
Uh oh!
There was an error while loading. Please reload this page.
What version of gRPC and what language are you using?
Version: grpc 1.69.0
Language: ruby 3.4.2 (2025-02-15 revision d2930f8e7a) +PRISM [x86_64-darwin24]
What operating system (Linux, Windows,...) and version?
MacOS Sequoia 15.3.1 (24D70)
What runtime / compiler are you using (e.g. python version or version of gcc)
Python 3.9.6
Apple clang version 17.0.0 (clang-1700.0.13.3)
Target: x86_64-apple-darwin24.3.0
What did you do?
Please provide either 1) A unit test for reproducing the bug or 2) Specific steps for us to follow to reproduce the bug. If there’s not enough information to debug the problem, gRPC team may close the issue at their discretion. You’re welcome to re-open the issue once you have a reproduction.
What did you expect to see?
grpc gem successfully installed
What did you see instead?
gem_make.txt
Main error as I see
Anything else we should know about your project / environment?
Already tried:
gem install grpc -- --with-zlib-dir=/usr/local/opt/zlib
The text was updated successfully, but these errors were encountered: