1. make sure you have all the packages through yum:
yum install mysql-devel irb rdoc ruby-devel ruby-mysql gcc2. also make sure to install mysql ruby gem
sudo gem install mysql3. it would give you the following errors:
ERROR: While executing gem ... (RuntimeError)4. goto the directory that it is trying to install from (look for the directory in the error message)
ERROR: Failed to build gem native extension.
Gem files will remain installed in /usr/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection.
ruby extconf.rb install mysql\nchecking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
cd /usr/lib/ruby/gems/1.8/gems/mysql-2.75. Now the rest of the tutorial should work.
sudo ruby extconf.rb --with-mysql-lib=/usr/lib/mysql
sudo gem install mysql