uninitialized constant MysqlCompat::MysqlRes (using mms2r gem)

前端 未结 25 2239
抹茶落季
抹茶落季 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:16

    My problem was due to my "mysql" being a 32-bit installation while ruby was 64 and 32-bit. Check with these commands

     file `which mysql` 
     file `which ruby`
    

    Both should match Mach-O 64-bit executable x86_64 or Mach-O 64-bit executable i386. I installed a 64-bit mysql, then

    export ARCHFLAGS="-arch x86_64" ; sudo gem install --no-rdoc --no-ri mysql -v 2.7 -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config
    

    and voila!

提交回复
热议问题