rubyの1.9.3-p385のコンパイルが失敗した時のメモ

2013年2月6日に、ruby 1.9.3-p385がリリースされたので、
早速、rbenvでインストールしようとしたところ、
エラーが出てコンパイルができなかった時の解決方法のメモ。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
Installing ruby-1.9.3-p385...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/p8/x23nd_qs0_7fsg0s5p7frq7w0000gn/T/ruby-build.20130210114753.2144
Results logged to /var/folders/p8/x23nd_qs0_7fsg0s5p7frq7w0000gn/T/ruby-build.20130210114753.2144.log

Last 10 log lines:
compiling regenc.c
compiling regerror.c
compiling regexec.c
compiling regparse.c
regparse.c:582:15: error: implicit conversion loses integer precision: 'st_index_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
return t->num_entries;
~~~~~~ ~~~^~~~~~~~~~~
1 error generated.
make: *** [regparse.o] Error 1
make: *** Waiting for unfinished jobs....

↓を実行するとうまくいった。

1
2
$ export CC=/usr/bin/gcc
$ rbenv install 1.9.3-p385