uninitialized constant MysqlCompat::MysqlRes (using mms2r gem)

前端 未结 25 2155
抹茶落季
抹茶落季 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:07
    sudo env ARCHFLAGS="-arch x86_64" gem install mysql
    

    Dmg package from the mysql site an ddone!

    0 讨论(0)
  • 2020-12-03 00:09
    sudo apt-get install libmysqlclient15-dev
    
    0 讨论(0)
  • 2020-12-03 00:11

    sudo gem install mysql -v 2.7 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

    Worked perfectly for me :)

    0 讨论(0)
  • 2020-12-03 00:12

    If you have mysql 5.5 follow this: http://geryit.com/blog/2011/01/installing-mysql-with-rails-on-mac-os-x-snow-leopard/

    FTR: If I didn't need some stupid rep to upvote I would have upvoted the identitcal answer, consider this my upvote.

    0 讨论(0)
  • 2020-12-03 00:12

    With mysql gem (2.8.1) I was getting

    uninitialized constant MysqlCompat::MysqlRes

    Using -v 2.7 make it work perfectly and for those who used Homebrew to install mysql

    sudo gem install mysql -v 2.7 -- --with-mysql-config=/usr/local/Cellar/mysql/5.1.48/bin/mysql_config

    Note that you can change mysql version if needed.

    0 讨论(0)
  • 2020-12-03 00:12

    Downgrade (from 5.9) to mysql 5.1 helped on 10.6 ... running both mysql and mysql2 gems.

    0 讨论(0)
提交回复
热议问题