Leo's Technical Blog

Quick Solution: MySQL gem on Snow Leopard

Introduction

user

Leo Soto


tips, ruby

Quick Solution: MySQL gem on Snow Leopard

Posted by Leo Soto on .
Featured

tips, ruby

Quick Solution: MySQL gem on Snow Leopard

Posted by Leo Soto on .

A few days ago I got the following error on a Rails application (after installing the mysql gem) on Snow Leopard:

  Error: uninitialized constant MysqlCompat::MysqlRes  

If you ever encounter this problem, uninstall the gem and reinstall it in the following way:

ARCHFLAGS="-arch i386 -arch x86_64" gem install mysql  -- --with-mysql-dir=/path/to/mysql/dir/ --with-mysql-config=/path/to/mysql/dir/bin/mysql_config

[Solution taken from here]