2013-02-06 22 views
1

錯誤紅寶石:不能加載這樣的文件 - 當我嘗試在Ubuntu 12.10安裝導軌我得到這個錯誤的zlib

$ gem install rails 
ERROR: Loading command: install (LoadError) 
cannot load such file -- zlib 
ERROR: While executing gem ... (NameError) 
uninitialized constant Gem::Commands::InstallCommand 

所以我完全去除RVM:

rvm implode 
sudo rm -rf ~/.rvm 

刪除腳本在我.bashrc.bash_profile

要求和檢查,如果他們真的刪除:

env | grep rvm #no output, so rvm is removed 
ruby -v #The program 'ruby' can be found in the following packages: blabla 

我通過sudo已經有這些的apt-get安裝:

curl zlib1g-dev zlib1g libssl-dev build-essential openssl libreadline6 libreadline6-dev curl git-core libyaml-dev libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev automake libtool bison subversion pkg-config 

然後繼續從頭開始安裝

curl -L https://get.rvm.io | bash -s stable --ruby --auto-dotfiles 

然後運行該行並重新啓動終端對於這個消息:

* To start using RVM you need to run `source /home/adige/.rvm/scripts/rvm` 
    in all your open shell windows, in rare cases you need to reopen all shell windows. 

Then rvm pkg install readline但完成時出現錯誤:

... 
Error running 'autoreconf -is --force', please read /home/adige/.rvm/log/readline/autoreconf.log 
... 
Please note that it's required to reinstall all rubies: 

    rvm reinstall all --force 

我認爲它是反正安裝的吧?之前重新安裝所有的紅寶石,我安裝了當然的zlib:

# w/out verify, it gives checksum error 
rvm pkg install zlib --verify-downloads 1 

然後運行rvm reinstall all --force,並再次完成時發生錯誤:

... 
Install of ruby-1.9.3-p374 - #complete 
Making gemset ruby-1.9.3-p374 pristine. 
Error running '' under , 
please read /home/adige/.rvm/log/ruby-1.9.3-p374/gemset.pristine.log 
Making gemset [email protected] pristine. 

gemset.pristine.log

然後重新安裝紅寶石支持zlib:

rvm reinstall 1.9.3-p374 --with-zlib-dir=$rvm_path/usr 

哪些返回了相同的錯誤和無論如何都完成了。

最後我試着再次安裝rails gem,但是cannot load such file -- zlib

這裏是rvm info

我在做什麼錯?

回答

1

你不應該安裝在Ubuntu readline/zlib,按照此步驟:

rvm get head 
rvm pkg remove 
rvm requirements run force 
rvm reinstall 1.9.3-p374 

確保包括安裝過程的輸出,如果失敗,還包括所有提到的日誌文件

相關問題