Skip to content
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

dyld troubles on macOS Mojave with mysql2 0.4.x #1001

Open
thegcat opened this issue Aug 30, 2018 · 13 comments
Open

dyld troubles on macOS Mojave with mysql2 0.4.x #1001

thegcat opened this issue Aug 30, 2018 · 13 comments

Comments

@thegcat
Copy link

thegcat commented Aug 30, 2018

When starting an existing rails 4 app on macOS Mojave with mysql2 0.4.6 (the results with mysql2 0.4.10 are the same):

dyld: lazy symbol binding failed: Symbol not found: _mysql_server_init
  Referenced from: /Users/thegcat/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/mysql2-0.4.6/lib/mysql2/mysql2.bundle
  Expected in: flat namespace

dyld: Symbol not found: _mysql_server_init
  Referenced from: /Users/thegcat/.rbenv/versions/2.3.7/lib/ruby/gems/2.3.0/gems/mysql2-0.4.6/lib/mysql2/mysql2.bundle
  Expected in: flat namespace

fish: 'rails s' terminated by signal SIGABRT (Abort)

I'm guessing the issue is related to some paths not being set correctly, but honestly I'm a bit at a loss here.

The mysql installation is a mysql 5.6 installed via homebrew, though the same errors also arise with mysql 5.7.

Different things I have tried, including building with --with-mysql-rpath=/usr/local/opt/mysql@5.6/lib, brew link --force-ing, exporting the mysql lib path in DYLD_LIBRARY_PATH amongst others did not yield a different result than above.

For the record: I had also tried mysql2 0.5.2, but as this won't even load into rails 4 I can't say wether it works better or not.

Any pointers on how to tackle this issue?

@sodabrew
Copy link
Collaborator

Could you try the latest point release of 0.4.x and see if that helps?

@thegcat
Copy link
Author

thegcat commented Aug 31, 2018

I tried the different steps with 0.4.10 too and got the same error as written above. I have just tried it again to confirm, the error is the same.

@thegcat
Copy link
Author

thegcat commented Sep 10, 2018

During the installation of the gem following message happens:

Don't know how to set rpath on your system, if MySQL libraries are not in path mysql2 may not load

Maybe this helps?

@thegcat
Copy link
Author

thegcat commented Sep 19, 2018

I have in the meantime completely nuked my home-brew install as well as my rbenv install and installed both and everything in that anew on macOS 10.14, sadly to no avail neither with mysql2 0.4.6 nor 0.4.10.

@tesssie
Copy link

tesssie commented Dec 5, 2018

@thegcat I had this issue. Hope you have xcode command line installed. I had to to install some missing header files by
open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

This linked helped me 52530212

@thegcat
Copy link
Author

thegcat commented Dec 5, 2018

@tesssie thanks a lot for the suggestion, after recompiling the mysql2 gems this seems to work.

@tesssie
Copy link

tesssie commented Dec 6, 2018

@thegcat recompiling manually?

@thegcat
Copy link
Author

thegcat commented Dec 6, 2018

Not really, just gem uninstall mysql2 and bundle install to install it back.

@tesssie
Copy link

tesssie commented Dec 7, 2018 via email

@D-Maher
Copy link

D-Maher commented Jan 23, 2019

@tesssie, thanks for your solution! This worked like a charm for me.

@tesssie
Copy link

tesssie commented Jan 24, 2019 via email

@patriciojofre
Copy link

Thank you @tesssie , you save my life!!

@gilangmugnirespaty
Copy link

Thank you @tesssie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants