Samples Blog contact support
Following install instructions leads to LoadError: Library not loaded: libmysqlclient.18.dylib

Support Ticket


A dynamic library needed for MySql fails to load.  The context is Mac OS 10.9.2, bash, RVM, ruby 1.9.3.  DYLD_LIBRARY_PATH is not set in this context and the dynamic library is not found. 

expand_less +example

While following the wagn installation instructions I entered rake wagn:create and got the following error:


LoadError: dlopen(/Users/phoenix/.rvm/gems/ruby-1.9.3-p448@wagn_wheels/gems/mysql2-0.3.15/lib/mysql2/mysql2.bundle, 9): Library not loaded: libmysqlclient.18.dylib

  Referenced from: /Users/phoenix/.rvm/gems/ruby-1.9.3-p448@wagn_wheels/gems/mysql2-0.3.15/lib/mysql2/mysql2.bundle

  Reason: image not found - /Users/phoenix/.rvm/gems/ruby-1.9.3-p448@wagn_wheels/gems/mysql2-0.3.15/lib/mysql2/mysql2.bundle

expand_less +discussion
I found a solution to the problem on StackOverflow.  It's not a wagn-specific problem & was tagged there as a Rails issue.  I never encountered this problem using Rails but ran into it with wagn because with Rails I'd only ever used sqlite; the problem is exposed when needing to load dynamix libraries.  I'm sure I won't be the last to run into this when trying wagn for the first time so I'm posting it here to save others' time.  

Credit for the original solution can be found in place at StackOverflow:

The solution is simple:

Excellent. Thanks so much for posting the solution!

--Ethan McCutchen.....2014-04-11 15:33:54 +0000