2009-09-01 53 views
1

因此,安装Ruby Enterprise Edition非常顺利(除了系统的一个非常奇怪的怪癖,我不得不apt-get install build-essentials,因为没有GCC ...) ),但未能正确安装任何数据库宝石。我主要想使用MySQL。这里的红宝石EE的./installer的mysql的宝石在安装过程中的输出:Ruby EE ./installer在mysql gem安装上失败

 
Installing mysql... 
/opt/ruby-enterprise-1.8.6-20090610/bin/ruby /opt/ruby-enterprise-1.8.6-20090610/bin/gem install -r --no-rdoc --no-ri --no-update-sources --backtrace mysql 
Building native extensions. This could take a while... 
ERROR: Error installing mysql: 
     ERROR: Failed to build gem native extension. 

/opt/ruby-enterprise-1.8.6-20090610/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 *** 

显然,我的服务器的MySQL安装没有附带源,所以我不能只是重新编译,希望它的工作...我尝试下载并编译该版本,但我不知道该从哪里做什么。有任何想法吗? MySQL已经在这台服务器上运行了不少的数据库,所以我宁愿不惹恼已经存在的东西......

回答

2

斗争的公平一点后,我开始通过​​浏览,希望能找到有可能解决这个问题的一个包。我发现libmysqlclient-dev,安装它,并重建宝石...它的工作。我觉得很愚蠢,嘿,但这只是我第一次尝试将Rails应用程序部署到真正的Web服务器。

0

你的系统是64位的吗?问题是,gem安装程序找不到mysqlclient。

1)使用定位来确保mysqlclient和mysql_config在您的系统上。您可能需要先更新locate db。 - 找到mysqlclient会显示一些以.so,.a等结尾的库文件。

2)尝试 /opt/ruby​​-enterprise/bin/ruby​​/opt/ruby​​-enterprise/bin/gem安装mysql - --with-mysql-config ='/ usr/bin/mysql_config'--no-rdoc --no-ri

(更新上面的使用mysql_config和ruby-enterprise的右侧目录)

拉里

+0

实际上它是32位。我确实运行了'locate'来寻找它,我不认为它出现了,这就是为什么我转向'aptitude'的原因。 感谢您的帮助! – Twisol 2009-09-01 03:40:47