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
4 comments:
Hey Mopy, I'm using FC4 and did all the steps you specify and still get errors during the last 'gem install mysql' (see below). Here's the versions of software I'm running, what are you using?
Your MySQL: 4.1.20
gem: 0.9.2
ruby 1.8.4 (2005-12-24) [i386-linux]
Rails 1.2.3
Thx.
Errors on 'gem install mysql'
===
Building native extensions. This could take a while...
ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)
ERROR: Failed to build gem native extension.
ruby extconf.rb install mysql
checking 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
===
Hey Luke, I haven't check this blog in a while. So, didn't get a chance to see your post. I haven't touch ruby on rails for a while. I have found cakePHP as a much better alternative. Hope you got it figured out.
I can't thank you enough for posting this. I've been banging my head against the wall for far too long.
sudo gem install mysql -- --with-mysql-lib=/usr/lib/mysql
Post a Comment