uninitialized constant MysqlCompat::MysqlRes (using mms2r gem)

前端 未结 25 2153
抹茶落季
抹茶落季 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-02 23:54

    The mysql and mysql2 gems both work on ruby 1.9.2 just update ruby and install the gem you need.

    0 讨论(0)
  • 2020-12-02 23:54

    How is the mysql dependency related to mms2r? I'm the mms2r author, btw.

    The mms2r gemspec https://github.com/monde/mms2r/blob/master/mms2r.gemspec does not list a mysql dependency.

    0 讨论(0)
  • 2020-12-02 23:55
    gem uninstall mysql
    
    gem install mysql -v 2.7 -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
    
    ldconfig /usr/local/mysql/lib/mysql
    
    RAILS_ENV=production rake db:migrate --trace
    

    This worked for me.

    0 讨论(0)
  • 2020-12-02 23:56

    If your Mysql version is 5.5 you should uninstall it. I just left an article about using mysql with ruby : http://geryit.com/blog/2011/01/installing-mysql-with-rails-on-mac-os-x-snow-leopard/

    0 讨论(0)
  • 2020-12-02 23:57

    I had the same problem after upgrading from Fedora 10 to Fedora 12. I fixed it by just uninstalling mysql gem and installing it again. So it complies with the new version of MySQL.

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

    On Mac OS X 10.6.4, I had to specify the architecture and config directory:

    sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

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