LoginSignup
2
2

More than 5 years have passed since last update.

Ruby 2.0.0をrvmでインストールしようとして妙にはまった

Posted at

たまに早く帰れるからって、色んなことやろうとするとこれだ。。。
というわけで後学の為にメモを残しておきます。ってか、残しておかないと絶対にまたはまる。

意気揚々と

とか

とかを見ながらrvm install 2.0.0とかする訳ですが、こける。ググっても何をやってもこける。
ここは一つ深呼吸ですよ。冷静に吐かれたエラー見ると、

rvm reinstall -force

とか書いてあるから実行したらremoveだけ上手く行ってインストールでこける。

え〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜〜

いや、ちょっと待て、ほんとにちょっと待て。。。明らかに二次災害じゃないかこれ。
もう、完全に心が折れかかってる中、もう一度深呼吸してインストールコマンド叩いてエラーを確認しますよっと。

Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.7/x86_64/ruby-2.0.0-p0.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Installing requirements for osx, might require sudo password.
Skipping brew update make sure your formulas are up to date.
Cowardly refusing to continue, please read 'rvm autolibs'.

(reinstallしろと出たのがどのタイミングだったか記憶にない。。。)

Cowardly refusing to continue, please read 'rvm autolibs'.

どうやらここが問題らしい。autolibsを読めと書いてある。
autolibsはどうやら依存関係のあるパッケージを自動的にインストールするためのRVMの機能っぽい。

rvm autolibs

でヘルプが確認できる。

〜抜粋〜

Modes

  • 0, disable, disabled  =>  Disable autolibs.
  • 1, read, read-only  =>  Do not fail if missing packages.
  • 2, fail, read-fail  =>  Fail if missing packages.
  • 3, packages, install-packages  =>  Install missing packages.
  • 4, enable, enabled  =>  Install packages and homebrew if missing.

各モードの

  • 0 => autolibsを解除
  • 1 => 依存関係のあるパッケージが見つからなくてもインストールは止めない、警告のみ
  • 2 => 依存関係のあるパッケージが見つからない場合はインストールを止める
  • 3 => パッケージマネージャを使って見つからなかったパッケージをインストールする(linux or mac)
  • 4 => homebrewを使って見つからなかったパッケージをインストールする(macのみ)

このモードが2になっているからこけていた、というのが今回の現象。
というか、いつからあるオプションなんだろう?2012年10月あたりにrvm使ってrubyをインストールしたときは少なくともオプションに気を使う必要がなかった。
他にもパッケージ管理ソフトを指定するオプションがあったり、状態を見るためのオプションがあるらしい。

という訳で気を取り直してrvm install 2.0.0を「ッターン」。

〜略〜
\Error running'env GEM_PATH=/Users/atom/.rvm/gems/ruby-2.0.0-p0:/Users/atom/.rvm/gems/ruby-2.0.0-p0@global:/Users/atom/.rvm/gems/ruby-2.0.0-p0:/Users/atom/.rvm/gems/ruby-2.0.0-p0@global GEM_HOME=/Users/atom/.rvm/gems/ruby-2.0.0-p0 /Users/atom/.rvm/rubies/ruby-2.0.0-p0/bin/ruby -d /Users/atom/.rvm/src/rubygems-2.0.3/setup.rb --verbose',
please read /Users/atom/.rvm/log/ruby-2.0.0-p0/rubygems.install.log
Installation of rubygems did not complete successfully.
〜略〜

orz
ログ見れ、って書いてあるから見てみる。

〜略〜
ERROR: While executing gem ... (NoMethodError)
undefined method `fu_stream_blksize' for #Gem::Commands::SetupCommand:0x007fcc21988218
〜略〜

これは結局、カズさん(@kazuhisa1976)に助けてもらいました。
検証してもらった結果、

*エラーは出ているがgemは普通に使えるからOK
*このエラーもそのうち直るだろうから、rvmの更新はこまめにして様子見

ということに。

さてさて、環境吹っ飛んだりしてるので後始末ですよ。。。

rvm install 1.9.3
rvm install 1.9.2
rvm use 1.9.3 --default
bundle install
gem install powder

他にも、自力でpowの設定をして.rvmrcとか作ってたプロジェクトの参照がおかしくなってるから.rvmrcと.powrcを消したりした。
新しく作ってる方のアプリでspecは流せたかし、powの連携確認もできた。

2
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
2