2011-08-03 14 views
16

Windows 7で新しく作成したUbuntu 11.04をVirtualBoxでインストールしました(これは重要かどうかは分かりません)UbuntuにRVMを新しくインストールしても宝石をインストールできません(zlibエラー)

は、私が手に私のルビーをリスト:

[email protected]:~$ rvm list 

rvm rubies 

=> ruby-1.9.2-p290 [ x86_64 ] 

が、その後レールの宝石をインストールしようと、私はこれを取得:私が間違って

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

何をしているのですか?

編集:
ディランが言ったことを私の出力を行った後(これらのライブラリは、現在インストールされていることを証明するために):

[email protected]:~$ sudo apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev 
[sudo] password for aaron: 
Reading package lists... Done 
Building dependency tree  
Reading state information... Done 
Note, selecting 'libxslt1-dev' instead of 'libxslt-dev' 
Note, selecting 'libncurses5-dev' instead of 'ncurses-dev' 
autoconf is already the newest version. 
bison is already the newest version. 
build-essential is already the newest version. 
git-core is already the newest version. 
libc6-dev is already the newest version. 
libncurses5-dev is already the newest version. 
libreadline6 is already the newest version. 
libreadline6-dev is already the newest version. 
libsqlite3-0 is already the newest version. 
libsqlite3-dev is already the newest version. 
libssl-dev is already the newest version. 
libxslt1-dev is already the newest version. 
libyaml-dev is already the newest version. 
openssl is already the newest version. 
sqlite3 is already the newest version. 
zlib1g is already the newest version. 
zlib1g-dev is already the newest version. 
curl is already the newest version. 
libxml2-dev is already the newest version. 
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. 
[email protected]:~$ gem install rails 
ERROR: Loading command: install (LoadError) 
    no such file to load -- zlib 
ERROR: While executing gem ... (NameError) 
    uninitialized constant Gem::Commands::InstallCommand 
[email protected]:~$ 

答えて

25

実行rvm notesとRVMを説明します物事をインストールするためにapt-getを使用してください。それは(zlib1g-develの行に沿った何かがそれらの1つになります)。 Ubuntuのために

、それはこのようなものでなければなりません:あなたは、その後(その100%ではないことを確認)をご1.9.2を再コンパイルする必要がある場合があります

/usr/bin/apt-get install build-essential bison openssl libreadline6 libreadline6-dev curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev

+0

ディラン最初はうまくいきませんでしたが、私は最後の部分を読んでいました:D。私は再コンパイルしなければならなかった。今それは動作します! – DJTripleThreat

+0

'sudo apt-get install libxml2-dev libxslt-dev'を実行するまで、' gem install'で何かをすることができませんでした。再コンパイルする必要はありませんでした。それだけで作業が始まりました。ありがとう。 –

19

私はパッケージzlibをインストールする必要があることを発見しました。これは上記パッケージをインストールした後です(rvmが言った)。 する必要があります:
rvm pkg install zlib
その後、ルビーを再インストールします。 rvm reinstall 1.9.3
実行 gem install rails
これは正常にレールをインストールします。

+0

素敵な答えが働いた!ありがとう!! – user352290

+0

非常に良い解決策。驚くばかり! – carnator

+0

私のために働いた!ありがとう。 –

0

RVMを信頼する場合は、次の2つのコマンドを実行できます。この

rvm requirements run 
rvm reinstall all --force 

次に、gem install railsコマンドが機能するはずです。

最初の手順では、RVMに必要なすべてのパッケージをインストールします。通常はすべてが必要なわけではありませんが、パッケージごとにパッケージを検索しようとしています。

ほとんどの人があなたの オペレーティングシステムのいずれかの依存関係の要件を実行してあるかどうかを確認、RVMのこの部分は最後に

をインストール欠場:

ユーザーの$ RVMの要件を

関連する問題