msgpack-ruby: Missing support for Apple Silicon

Calling msgpack-ruby on Mac with Apple Silicon will show LoadError: dlopen(/Users/tonywu/Downloads/msgpack-ruby-master/lib/msgpack/msgpack.bundle, 0x0009): missing compatible arch in /Users/tonywu/Downloads/msgpack-ruby-master/lib/msgpack/msgpack.bundle - /Users/tonywu/Downloads/msgpack-ruby-master/lib/msgpack/msgpack.bundle Since msgpack has supported Apple Silicon, I hope the msgpack-ruby can add support to it soon. Thanks for your great effort!

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 1
  • Comments: 16 (5 by maintainers)

Most upvoted comments

I needed to delete some gems that were targeting a wrong architecture.

These instructions use bundle, but you can adapt them to whatever you use. This worked for me:

  1. Open a new terminal, make sure running arch outputs arm64
  2. Delete your gems. Because I use bundle, I followed this SO answer:
    1. Comment all the lines of your Gemfile
    2. Run bundle clean --force
    3. Revert commenting the lines of your Gemfile
  3. Install your gems. With bundle:
    1. Run bundle install

Hi, can someone make this more clear? I don’t understand what solved the issue.

It is caused by rubygems which copies shared objects to the library path w/o the arch name. The same shared object should exist under /opt/homebrew/lib/ruby/gems/2.7.0/. If there is the bundle for arm, you will be able to load it by removing the wrong bundle file under /opt/homebrew/lib/ruby/gems/2.7.0/gems/.

@cmolina Hey, after a day of trial and errors we have solved the same problem! Thx 🥳

@cmolina Many thanks! After a day trying this actually solved the problem.

@cmolina Thanks. This was the only thing that worked after countless hours trying!

Could you check what will happen when you do the commands below?:

$ uname -a
$ gem i msgpack
$ ruby -e 'p RUBY_VERSION; require "msgpack"`