dyld: lazy symbol binding failed: Symbol not found: _grpc_set_ssl_roots_override_callback

Viewed 1352

Mac Book Air(M1)

OS: macOS BigSur(11.2)
Rails version: 5.2.3
ruby version: 2.5.3p105
bundle list:

  • google-protobuf (3.15.5)
  • googleapis-common-protos-types (1.0.6)
  • grpc (1.36.0)
$ rails c
dyld: lazy symbol binding failed: Symbol not found: _grpc_set_ssl_roots_override_callback
  Referenced from: /Users/[hostname]/.rvm/gems/ruby-2.5.3@square_rpc/gems/grpc-1.36.0/src/ruby/lib/grpc/grpc_c.bundle
  Expected in: flat namespace

dyld: Symbol not found: _grpc_set_ssl_roots_override_callback
  Referenced from: /Users/[hostname]/.rvm/gems/ruby-2.5.3@square_rpc/gems/grpc-1.36.0/src/ruby/lib/grpc/grpc_c.bundle
  Expected in: flat namespace

I have run bundle pristine.
So I think I should have using the right version which has support M1 as document saying.

Any one knows how to solve this problem?
Thanks.

1 Answers

I think I can finally answer this in a simple way. The answer is simply to upgrade to Ruby 2.7 and have at least grpc 1.38.0 in your Gemfile

My understanding and explanation is that somewhere in the Mac M1 change, there was an issue with the earlier version of grpc. Whoever was maintaining this gem heard from the people and eventually they were able to make bug fixes that solved the issue. For some this was in grpc 1.38.0, however for others it was listed as recently as 1.42.0.

I believed this was solved months ago, but that there is a second part of the problem. That being the version of Ruby. I was using 2.6.6 and still having issues even though I was following everyone else's solutions and seeing the reactions that it solved their issues. However, I finally found a comment suggesting the flaw is in Ruby 2.6. So I upgraded to 2.7.5 and viola, I don't see the issue anymore.

So my suggestion is to upgrade to ruby 2.7 however it could be that 2.6.7 - 2.6.9 also solved this linking issue. So you can try those as well if you don't want or unable to upgrade to 2.7.

Related