Rails + MySQL on Mavericks - Library not loaded: libmysqlclient.18.dylib -



Rails + MySQL on Mavericks - Library not loaded: libmysqlclient.18.dylib -

when run rails (rails s) app on localhost (osx mavericks), error

message:/users/adam/.rvm/gems/ruby-2.0.0-p481/gems/mysql2-0.3.16/lib/mysql2.rb:8:in `require': dlopen(/users/adam/.rvm/gems/ruby-2.0.0-p481/extensions/x86_64-darwin-13/2.0.0-static/mysql2-0.3.16/mysql2/mysql2.bundle, 9): library not loaded: libmysqlclient.18.dylib (loaderror) referenced from: /users/adam/.rvm/gems/ruby-2.0.0-p481/extensions/x86_64-darwin-13/2.0.0-static/mysql2-0.3.16/mysql2/mysql2.bundle reason: image not found - /users/adam/.rvm/gems/ruby-2.0.0-p481/extensions/x86_64-darwin-13/2.0.0-static/mysql2-0.3.16/mysql2/mysql2.bundle /users/adam/.rvm/gems/ruby-2.0.0-p481/gems/mysql2-0.3.16/lib/mysql2.rb:8:in `<top (required)>' /users/adam/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `require' /users/adam/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:76:in `block (2 levels) in require' /users/adam/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `each' /users/adam/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:72:in `block in require' /users/adam/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `each' /users/adam/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler/runtime.rb:61:in `require' /users/adam/.rvm/gems/ruby-2.0.0-p481@global/gems/bundler-1.6.2/lib/bundler.rb:132:in `require' /users/adam/rubydev/logistadvise/config/application.rb:7:in `<top (required)>' /users/adam/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require' /users/adam/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>' /users/adam/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap' /users/adam/.rvm/gems/ruby-2.0.0-p481/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>' bin/rails:4:in `require' bin/rails:4:in `<main>'

i not sure how installed mysql, guess it's in subfolder called cellar.

here's how bash_profile looks like:

mysql=/usr/local/mysql/bin export path=$path:$mysql export dyld_library_path=/usr/local/mysql/lib:$dyld_library_path export pg_dump="/applications/postgres.app/contents/macos/bin/" #path=$pg_dump:$path ...

how solve issue?

i had same problem. because installed brew, location of dyld changed. seek this:

export dyld_library_path=/usr/local/mysql-5.1.67-osx10.6-x86_64/lib:$dyld_library_path

check if path above exists first next , adjust export path accordingly:

ls -1 /usr/local/mysql-5.1.67-osx10.6-x86_64

you create symbolic link or something. kind of annoying me, using right path fixed me.

and seek which mysql check if have mysql in path. if don't output paths messed up.

mysql ruby-on-rails ruby osx-mavericks

Comments

Popular posts from this blog

php - Android app custom user registration and login with cookie using facebook sdk -

django - Access session in user model .save() -

php - .htaccess Multiple Rewrite Rules / Prioritizing -