“gem install mysql” failed. This might be another stupid question, but
really block me for couple of days.
I tried gem:
gem install mysql – --with-mysql-config=/usr/bin/mysql_config
and got:
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/usr/local/bin/ruby extconf.rb
–with-mysql-config=/usr/bin/mysql_config
extconf.rb:1: command not found: /usr/bin/mysql_config --cflags
*** extconf.rb failed ***
This might be something wrong with mysql becouse ‘mysql_config’ can not
be located.
[root@localhost ~]# whereis mysql_config
mysql_config:
I also tried mysql-ruby:
[root@localhost mysql-ruby-2.8.1]# ruby extconf.rb
–with-mysql-dir=/usr/bin/mysql
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lm… no
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lz… no
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… no
checking for mysql_query() in -lmysqlclient… no
checking for main() in -lmygcc… no
checking for mysql_query() in -lmysqlclient… no
*** extconf.rb failed ***
here is the env info:
Linux version 2.6.18-128.4.1.el5PAE ([email protected])
(gcc version 4.1.2 20080704 (Red Hat 4.1.2-44)) #1 SMP Tue Aug 4
20:58:34 EDT 2009
[root@localhost ~]# whereis mysql
mysql: /usr/bin/mysql /usr/local/lib/mysql /usr/share/mysql
/usr/share/man/man1/mysql.1.gz
[root@localhost ~]# ruby -v
ruby 1.8.6 (2008-03-03 patchlevel 114) [i686-linux]
[root@localhost ~]# rails -v
Rails 2.3.3
[root@localhost ~]# gem -v
1.3.5
any suggestion will be appreciate