% rbenv versions
system
* 2.0.0-p0 (set by /Users/katsuji/.rbenv/version)
という状態でさて 1.9.3-p392 も入れておこうと rbenv install すると、
% rbenv install 1.9.3-p392
Downloading yaml-0.1.4.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/36c852831d02cf90508c29852361d01b
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/katsuji/.rbenv/versions/1.9.3-p392
Downloading ruby-1.9.3-p392.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz
Installing ruby-1.9.3-p392...
BUILD FAILED
Inspect or clean up the working tree at /var/folders/3z/vb998x_n52dd3vhwhh_wvssw0000gp/T/ruby-build.20130304021150.22449
Results logged to /var/folders/3z/vb998x_n52dd3vhwhh_wvssw0000gp/T/ruby-build.20130304021150.22449.log
Last 10 log lines:
compiling safe.c
compiling signal.c
compiling sprintf.c
compiling st.c
st.c:520:35: error: implicit conversion loses integer precision: 'st_index_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
i = table->num_entries++;
~ ~~~~~~~~~~~~~~~~~~^~
1 error generated.
make: *** [st.o] Error 1
make: *** Waiting for unfinished jobs....
と、ビルドできなかったので CFLAGS を設定して回避。
% CFLAGS=-Wno-error=shorten-64-to-32 rbenv install 1.9.3-p392
Downloading yaml-0.1.4.tar.gz...
-> http://dqw8nmjcqpjn7.cloudfront.net/36c852831d02cf90508c29852361d01b
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/katsuji/.rbenv/versions/1.9.3-p392
Downloading ruby-1.9.3-p392.tar.gz...
-> http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p392.tar.gz
Installing ruby-1.9.3-p392...
Installed ruby-1.9.3-p392 to /Users/katsuji/.rbenv/versions/1.9.3-p392
% rbenv versions
system
1.9.3-p392
* 2.0.0-p0 (set by /Users/katsuji/.rbenv/version)
ちょっとぐぐってみると
・Apple の gcc に入ってる独自オプション
・clang にも同様のオプションあり
・バージョンによって判定が賢くなってひっかかるようになった
という。