If there is an error when staring a Rails application via a MySQL connection:
Status: 500 Internal Server Error
uninitialized constant MysqlCompat::MysqlRes
Assume MySQL is already installed, for example, via homebrew: brew install mysql or other means.
1. Un-install the existing mysql gem (if any):
sudo gem uninstall mysql
2. Locate the ‘mysql_config’ file:
find /usr -name 'mysql_config'
3. Re-install mysql gem:
sudo env ARCHFLAGS="-arch x86_64" gem install mysql -- --with-mysql-config=/usr/local/bin/mysql_config
Note: replace ‘/usr/local/bin/’ with the corresponding mysql_config path found in step 2.
cheers~
About