uninitialized constant MysqlCompat::MysqlRes (using mms2r gem)

前端 未结 25 2288
抹茶落季
抹茶落季 2020-12-02 23:48

moved a rails app of mine onto a new server and had to install a few gem dependencies. However, after installing the mysql gem I get the error, uninitialized constant Mysql

25条回答
  •  天涯浪人
    2020-12-03 00:20

    Basically the problem is the the dynamic library libmysqlclient can't be found. The above solutions will work, but you need to reapply them any time you rebuild the gem, or when you install a new version of MySQL.

    An alternative approach is to add the MySQL directory containing the library to your dynamic load path. Putting the following in my .bashrc file solved the problem:

    export DYLD_LIBRARY_PATH="/usr/local/mysql/lib:$DYLD_LIBRARY_PATH"
    

提交回复
热议问题