LoginSignup
24
23

More than 5 years have passed since last update.

アップデートした El Capitan で Library not loaded: libmysqlclient.18.dylib (LoadError) と出る

Last updated at Posted at 2015-10-03

Yosemite から El Capitan にアップデートしたら、rails sをしたら、

bin/rails:6: warning: already initialized constant APP_PATH
***/bin/rails:6: warning: previous
definition of APP_PATH was here Usage: rails COMMAND [ARGS]

The most common rails commands are:  generate    Generate new code
(short-cut alias: "g")  console     Start the Rails console (short-cut
alias: "c")  server      Start the Rails server (short-cut alias: "s")
dbconsole   Start a console for the database specified in
config/database.yml
             (short-cut alias: "db")  new         Create a new Rails application. "rails new my_app" creates a
             new application called MyApp in "./my_app"

In addition to those, there are:  application  Generate the Rails
application code  destroy      Undo code generated with "generate"
(short-cut alias: "d")  plugin new   Generates skeleton for developing
a Rails plugin  runner       Run a piece of code in the application
environment (short-cut alias: "r")

All commands can be run with -h (or --help) for more information.

と出るようになってしまいました。

rake rails:update:bin を打つと、情報が出てくるということで(http://ja.stackoverflow.com/questions/10290/warning-already-initialized-constant-app-path)打ってみたところ、
Library not loaded: libmysqlclient.18.dylib (LoadError) と出てしまいました。。。

どうやら、 libmysqlclient.18.dylib が見つからない模様。

Yosemite までは、 sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/lib/libmysqlclient.18.dylib とやるといいらしいんですが、例によってできないので、

sudo ln -s /usr/local/mysql/lib/libmysqlclient.18.dylib /usr/local/lib/libmysqlclient.18.dylib

Relative path not allowed in OS X: "unsafe use of relative rpath libmysqlclient.18.dylib" · Issue #646 · brianmario/mysql2

El Capitanだとこれが有効なようです。
これで、Library not loaded: libmysqlclient.18.dylib (LoadError) は出なくなりました。

24
23
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
24
23