1

When installing the ruby mysql gem by doing:

sudo gem install mysql

Subsequent rails migrations still fail, with a message like:

$ rake db:migrate
(in /Users/guy/code/project)
rake aborted!
uninitialized constant MysqlCompat::MysqlRes

(See full trace by running task with --trace)

How can I fix this?

1 Answers1

1

In order to fix this issue (at the time of this question), you'll need to set an additional environment variable during installation.

For a 32-bit platform, do:

sudo env ARCHFLAGS="-arch i386" gem install mysql

For a 64-bit platform, do:

sudo env ARCHFLAGS="-arch x86_64" gem install mysql

Once complete, your migrations should succeed (assuming no other factors were impeding the migrations).