2009-09-01 70 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