2011-02-02 79 views
1

我讀過一篇類似的文章,但我沒有使用ubuntu,也沒有apt-get。ruby​​ on EC2安裝zlib問題

僅供參考,UNAME:x86_64的x86_64的x86_64的GNU/Linux的

在嘗試做 「創業板安裝導軌」,我得到

[[email protected] ruby-1.9.2-p136]# gem install rails 
ERROR: Loading command: install (LoadError) 
    no such file to load -- zlib 
ERROR: While executing gem ... (NameError) 
    uninitialized constant Gem::Commands::InstallCommand 

然而,當我做 「百勝安裝的zlib」,它說已安裝。

[[email protected] ruby-1.9.2-p136]# yum install zlib 
Loaded plugins: fastestmirror, security 
Loading mirror speeds from cached hostfile 
Setting up Install Process 
Package zlib-1.2.3-24.6.amzn1.x86_64 already installed and latest version 
Nothing to do 

我試過which zlib並確認它不存在。有小費嗎?

謝謝。

回答

3

是的!我找到了答案在這裏:http://lucaschan.com/weblog/2007/03/22/installing-ruby-on-rails-on-centosredhat-4x/

我只需要他的指令是去到源的一個子集和:

cd ruby-1.9.2-p136/ext/zlib/ 
ruby extconf.rb --with-zlib-include=/usr/include --width-zlib-lib=/usr/lib 
gem install rails --include-dependencies 

這就是它!由於盧卡斯;)

+0

`--width-zlib的-lib`也許應該是`--with-zlib的-lib`。我不確定@理查德的提議 - 編輯,似乎不太可能,但不知道我不熱衷於編輯帖子來自己解決這個問題。 – sarnold 2011-06-15 02:43:13

0

我就遇到了這個問題,有一天,我的解決方案是:「切換到REE」 ......其正確地安裝寶石