ERROR: Error installing mysql: ERROR: Failed to build gem native extension
The reason was that the Mysql files are installed under version specific directories and files when installing from Macports. For example,
/opt/local/lib/mysql5. This messes up the mysql gem installation because it looks elsewhere by default. The solution is to specify the exact mysql config location in the installation process:
bash-3.2# /opt/ruby-enterprise-1.8.6-20090201/bin/ruby \ /opt/ruby-enterprise-1.8.6-20090201/bin/gem install mysql \ -- --with-mysql-config=/opt/local/bin/mysql_config5
That last line is two dashes (-) followed by the
Easy as pie.