LoginSignup
23

More than 3 years have passed since last update.

いつもいつも忘れてしまうのでruby-buildのconfigureオプションの設定についてメモっておく

Last updated at Posted at 2014-05-11

毎度毎度ググったりruby-buildのページを見るのもだるくなってきたので、ここらでメモ書きしておいて、記憶に定着させる。

ruby-buildのconfigureオプション

ruby-buildで必要な環境変数についてはruby-buildのCustom Build Definitionsのところに書かれている。この中で今回必要としているのは以下の2つ。

  • CONFIGURE_OPTS
  • RUBY_CONFIGURE_OPTS

CONFIGURE_OPTS

CONFIGURE_OPTS lets you pass additional options to ./configure.

先ほどのSpecial enviroment variablesから引用すると、CONFIGURE_OPTSは文字通り./configureにoptionを渡すことになる。

RUBY_CONFIGURE_OPTS

変わってRUBY_CONFIGURE_OPTSの場合はどうなるかというと、こちらもconfigureにoptionを渡すのは同じだがrubyに対してのみ適応される。これは例えばruby-buildでrubyインストール時に依存関係があるライブラリに対しては適応されない。

ついでにSpecial enviroment variablesの文章からすると、この環境変数はMRI(CRuby)のみ有効と読み取れる。確かにrubiniusをビルドするとBUILD FAILDになります。

$ CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" RUBY_CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install rbx-2.2.6
Downloading rubinius-2.2.6.tar.bz2...
-> http://releases.rubini.us/rubinius-2.2.6.tar.bz2
Installing rubinius-2.2.6...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/_7/12w0r1850z9c0lp6sxr9x6ww0000gn/T/ruby-build.20140511110113.7856
Results logged to /var/folders/_7/12w0r1850z9c0lp6sxr9x6ww0000gn/T/ruby-build.20140511110113.7856.log

Last 10 log lines:
   --without-dtrace           Disable dtrace
   --with-rpath               Enable rpath
   --without-rpath            Disable rpath

 Help!
   --show                     Print the current configuration and exit
   -V, --verbose              Print additional info
   -h, --help                 Show this message

Unrecognized option: --with-readline-dir=/usr/local/opt/readline

結論

今のところ自分の環境でconfigureオプションが必要となるのはMac環境のみ(opensslとreadlineをbrewでインストールしたものにしておきたい)だけで、かつruby-buildで依存ライブラリがインストールされるバージョンではないので(2.0以降はなかった記憶)、どちらで設定してもあまり変わりなさそうと思える。ひとまずCONFIGURE_OPTSで設定するようにするかな。

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
23