Library not loaded libgmp.10.dylib on self-hosted macos M1
See original GitHub issueusing: self-hosted macOS (M1 chip)
- name: Install ruby
uses: ruby/setup-ruby@v1
env:
ImageOS: macos1015
1st libgmp.10.dylib error:
The installation failed on “Print Ruby version” step with the error below:
Reason: tried: '/usr/local/opt/gmp/lib/libgmp.10.dylib' (no such file), '/usr/local/lib/libgmp.10.dylib' (no such file), '/usr/lib/libgmp.10.dylib' (no such file)

I have gmp installed with homebrew and hence the libgmp.10.dylib is located under /opt/homebrew/Cellar/gmp/6.2.1_1/lib/libgmp.10.dylib
2nd libgmp.10.dylib error
I manually installed gmp to ensure /usr/local/lib/libgmp.10.dylib will be available
but then, got a new error:
'/usr/local/lib/libgmp.10.dylib' (mach-o file, but is an incompatible architecture (have 'arm64', need 'x86_64')),

Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:19 (6 by maintainers)
Top Results From Across the Web
Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib ...
dylib ) works for each terminal session, but not permanently. I am running OS 10.9.5. This is what works temporarily: rvm reinstall 2.1.4....
Read more >dyld: Library not loaded: /usr/local/lib/libgmp.10.dylib ... - GitHub
Now that everything is installed, here is the error popping up when i load in Vim on OSX: syntastic: error: checker output: dyld:...
Read more >Unable to bootstrap GDK - missing `libgmp.10.dylib` - GitLab
Overview I have GMP installed (and did brew reinstall gmp too), ... dyld[53684]: Library not loaded: /usr/local/opt/gmp/lib/libgmp.10.dylib ...
Read more >Issues · ruby/setup-ruby · GitHub
Library not loaded libgmp.10.dylib on self-hosted macos M1. #341 opened May 18, 2022 by m2hd1 · 16. Consider bundle groups in cache keys....
Read more >incompatible library version | Apple Developer Forums
It says `gmp` in the correct path is not loaded since its version is `13.0.0`, but it is `14.0.0`! I know I have...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It won’t. The tool checks the
.../actions-runner/_work/_tool/Ruby/{version}/{os_architecture}for existing cache and if it doesn’t exist this action will download a new on into thehostedtoolcachefolder and overwrite whatever is there.Since Github Actions supports M1 self hosted runners it would be nice for this action to have the MacOS arm builds. However automating that is obviously hard since Github doesn’t have any MacOS arm runners.
After some more headache with this problem I don’t think @Shahaed python script will solve the issue for me. I already have an arm64 built binary of Ruby installed on the machine via
rbenv. The python script only seem to care about homebrew installs.So my solution was to create a symlinks in
/Users/runner/hostedtoolcacheto therbenvinstall of Ruby similar to how @Shahaed python script does for homebrew installed Cellars.Then I have a script that is run before runner jobs that will execute
ln -fs /Users/runner/hostedtoolcache/Ruby /Users/runner/actions-runner/_work/_toolSo in short
This can be a temporary solution for those with
rbenvruby until this action,setup-ruby, have solved arm64 macos builds that are pulled down by the action.