我在使用Ruby 1.9.2在RedHat 4上安装MySQL-Ruby时遇到了非常困难的困难。我是一个公司代理的背后,几乎可以防止任何包工具连接到外部存储库,因此“gem install mysql”不会削减它。我已尝试在本地安装mysql-ruby gem,但它失败并带有一个神秘的:
$gem install mysql-2.8.1.gem
Building native extensions. This could take a while...
ERROR: Error installing mysql-2.8.1.gem:
ERROR: Failed to build gem native extension.
/ns/local/apps/internal/SWS/MetricsPublisher/ruby/bin/ruby extconf.rb
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
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
我也尝试按照附带的自述文件自己构建模块。结果:
$ruby extconf.rb --with-mysql-include=/path_to_my_sql_headers/mysql/include/ --with-mysql-lib=/path_to_my_sql_lib/mysql/lib/
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
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
有人有什么想法吗?坦率地说,我甚至不关心MySQL-Ruby是否有效,我只想通过ruby 1.9中的ruby调用连接到MySQL数据库。谢谢。
pkg-config找不到-lmysqlclient的样子
—
RobotHumans