(homebrewで)readlineを6.3.3にするとreadlineを使ったRuby 2.x.xのインストールで失敗する('14/4/14〜5/10)

更新:readline 6.3.5以上でpatchなしインストールが可能になったようです

Homebrewの場合は5/10に6.3.5になりました。
readline 6.3.5 · d62a6cf · Homebrew/homebrew

Ruby 2.1.1 を rbenv で入れようとするとビルドがコケる。
brew な readline が 6.3.3 にいつの間にか上がってて、それだとマズいらしい。
と思ったら brew 側の readline が 6.3.5 に上がってた。
のと、Rubyも2.1.2 が出てた。
なんか素直に2.1.1も2.1.2も入った。
atton.blog: rbenv と readline でゴニョゴニョした話

ということでこの記事は古くなりました。
ご利用ありがとうございました。

(以下は元の記事)

Qiitaにアップしました。

Ruby 2.1.1 / 2.0.0をreadline 6.3の環境でもインストールするには - Qiita
結論としてはrbenv install --patchでパッチを当ててインストールする必要がある、ということ。
Rubyの上書きインストールの場合はrbenv install -fで強制インストールしてください。

2.1.1

curl -sSL https://gist.github.com/mislav/a18b9d7f0dc5b9efc162.txt | env CONFIGURE_OPTS="--enable-shared --with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install -f --patch 2.1.1

2.0.0-p451

2.0.0-p451/p353/p247/p195/p0全てで同じパッチを使えます。

curl -sSL https://gist.github.com/riocampos/b2669b26016207224f06.txt | env CONFIGURE_OPTS="--enable-shared --with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install -f --patch 2.0.0-p451

資料

  • readlineに関するhomebrewのgit-log全て
/usr/local/ $ git log master -- Library/Formula/readline.rb
commit 1294240c399144786e83d02ff516936a7a7c55bd
Author: BrewTestBot <brew-test-bot@googlegroups.com>
Date:   Sun Apr 13 21:04:34 2014 +0100

    readline: update 6.3.3 bottle.

commit 7cef7aeba491b4c13dcd5173d4244841d3321107
Author: Jack Nagel <jacknagel@gmail.com>
Date:   Sun Apr 13 12:16:07 2014 -0500

    readline 6.3.3

commit 0181c8a1633353affefabe257c170edbd6d7c008
Author: Jack Nagel <jacknagel@gmail.com>
Date:   Thu Mar 20 14:05:18 2014 -0500

    readline: use patch DSL

commit 3c86d2b8ffdcb854c88553c86b7911dfbb9766db
Author: Mike McQuaid <mike@mikemcquaid.com>
Date:   Sat Dec 14 18:13:11 2013 +0000

    Update docs, comment mxcl/homebrew refs.

commit b3f5f76e81b2533e9ac0e637ce2811b8928137a8
Author: Jack Nagel <jacknagel@gmail.com>
Date:   Wed Dec 4 22:49:01 2013 -0600

    readline: restore relocatable bottle

commit cfa81de1e0b6a20de5379a92025acbdd4db72d01
Author: Jack Nagel <jacknagel@gmail.com>
Date:   Wed Dec 4 22:37:58 2013 -0600

    Temporarily disable cellar :any
    
    These need to be updated to reflect changes to relocation.

commit 45d6b0ca491717781fcc1669186033438e682220
Author: Mike McQuaid <mike@mikemcquaid.com>
Date:   Mon Oct 28 11:19:19 2013 +0000

    readline: add mavericks bottle.

commit 657d2c206e0c116c95d7771ab8998af752094f79
Author: Mike McQuaid <mike@mikemcquaid.com>
Date:   Wed Sep 18 10:57:08 2013 +0100

    readline: add bottle.

commit 4e8bf33455f21b0cdb00c1171d75b9fc3f00654f
Author: Tryn Mirell <tryn@mirell.org>
Date:   Sat Aug 3 01:18:58 2013 -0500

    readline: add Darwin 13 as a build target
    
    Closes #21625.
    
    Signed-off-by: Adam Vandenberg <flangy@gmail.com>

commit bdaae65b9af7e5a00c106bdbdb07992b5ad343de
Author: Jack Nagel <jacknagel@gmail.com>
Date:   Sat Nov 10 21:12:26 2012 -0600

    Revert "Rename readline to gnu-readline"
    
    This reverts commit adee5315265cc46aa6a3057071527abb16e1cd94.
    
    Turns out one of the "other things" is a dealbreaker.
    
    We only create kegs using a formula's canonical name. However, we do not
    check that this is the case when mapping existing kegs back to formula
    objects, and thus a keg with a name that happens to be an alias can fool
    Homebrew into thinking the canonically-named keg exists.
    
    So anything that enumerates kegs and then tries to do stuff with the
    resulting formula objects will just break. This is obviously worse than
    the debugger being broken, so reverting this for the time being.

commit adee5315265cc46aa6a3057071527abb16e1cd94
Author: Jack Nagel <jacknagel@gmail.com>
Date:   Fri Nov 9 19:55:57 2012 -0600

    Rename readline to gnu-readline
    
    The Readline class clashes with the Readline module from the Ruby
    stdlib. This has mostly worked, but with the recent debugging support's
    integration of IRB, it is no longer possible for them to coexist. So we
    need to rename it.
    
    The implications of this are:
    
     - Anything that depends on readline will reinstall it as
       "gnu-readline". Anything already installed will continue to function.
    
     - "brew upgrade readline" will say "gnu-readline not installed", as
       "readline" is now an alias.
    
     - Probably other things.
    
    So there are some downsides, but we will just have to deal with them.
    
    Fixes #15776.

commit e2103de724a9936a7777178cea9d54ccde73c376
Author: Adam Vandenberg <flangy@gmail.com>
Date:   Mon Jul 30 12:33:08 2012 -0700

    readline: vendorize patches
    
    Downloading from mirrors is unreliable.
    
    Closes #13763.

commit 4237ea1c2c4c10a4c5288d11c0f0311e97f30473
Author: Jack Nagel <jacknagel@gmail.com>
Date:   Tue Jul 17 12:50:54 2012 -0500

    readline 6.2.4
    
    Signed-off-by: Jack Nagel <jacknagel@gmail.com>

commit 7da0499877c3b1a7f593aed921414f3ef973b027
Author: Jack Nagel <jacknagel@gmail.com>
Date:   Tue Dec 20 17:54:06 2011 -0600

    readline 6.2.2
    
    Patchlevel 2 incorporates a patch to fix Lion support which we were
    simulating with inreplace.
    
    Signed-off-by: Jack Nagel <jacknagel@gmail.com>

commit 164c57f284aa254a96935bb75ca5f25cf4e50714
Author: Jack Nagel <jacknagel@gmail.com>
Date:   Wed Nov 30 12:56:07 2011 -0600

    Add mirrors for GNU formulae
    
    Signed-off-by: Jack Nagel <jacknagel@gmail.com>

commit d0dfc22b504062808119afd95322ef88f0e4b79b
Author: Jack Nagel <jacknagel@gmail.com>
Date:   Mon Sep 12 11:31:30 2011 -0500

    Use automatic mirror selection for GNU downloads
    
    It seems that the main GNU download site has issues in some places
    outside the U.S., so we'll use the provided "ftpmirror.gnu.org" to pick
    a nearby mirror.
    
    Signed-off-by: Jack Nagel <jacknagel@gmail.com>

commit 2e9d3c79bb51b1c1375cba514285580151212e8d
Author: Caio Chassot <dev@caiochassot.com>
Date:   Thu Apr 14 23:43:11 2011 +0200

    readline: fix building dynamic libraries under Lion
    
    Adds "Darwin11" as a recognized OS.
    
    Resolves issue #4782
    
    Signed-off-by: Adam Vandenberg <flangy@gmail.com>

commit efdd19dbf33c5000bfa9b4bec36ab01aafda2c55
Author: Birger J. Nordølum <birgerjn@gmail.com>
Date:   Mon Apr 11 18:07:07 2011 +0200

    Add explicit version number for Readline.
    
    Signed-off-by: Adam Vandenberg <flangy@gmail.com>

commit 4f4bec73dbdbc0c90d32fdf323ee1eca148abe76
Author: Birger J. Nordølum <birgerjn@gmail.com>
Date:   Mon Apr 11 01:39:36 2011 +0200

    Readline 6.2.1
    
    Signed-off-by: Adam Vandenberg <flangy@gmail.com>

commit 302b384d214e68373adddc19f5b34907e8fed786
Author: Adam Vandenberg <flangy@gmail.com>
Date:   Wed Mar 16 21:36:36 2011 -0700

    readline: change keg-only message a bit

commit 0476235ce0724f8ce6729c7962184207342fe938
Author: Adam Vandenberg <flangy@gmail.com>
Date:   Wed Mar 9 21:11:03 2011 -0800

    Use ruby style for inheritance.

commit 7871a99fe3439f457634e5792dd2f7b127fdd2dc
Author: Tianyi Cui <tianyicui@gmail.com>
Date:   Thu Nov 11 02:16:28 2010 +0800

    Use https for all GitHub URLs
    
    Signed-off-by: Adam Vandenberg <flangy@gmail.com>

commit ceea8c4a2c5f9ba5581072201021986447ae088a
Author: Adam Vandenberg <flangy@gmail.com>
Date:   Wed Sep 29 21:43:45 2010 -0700

    readline - using collect was silly

commit a0c86dc431248056fc6f7381eaa44b7206e76a35
Author: David Höppner <0xffea@gmail.com>
Date:   Sun Aug 29 17:28:30 2010 +0200

    readline: update version to 6.1

commit d0efd9ee94a55e243f3b10e903526274fc21d569
Author: Adam Vandenberg <flangy@gmail.com>
Date:   Tue Apr 6 22:58:35 2010 -0700

    Update formulae for version 0.7
    
    * Use new "url" features
    * Use keg_only DSL
    * Use "skip_clean :all" DSL
    * Whitespace and style cleanups
    * Make bash invocations less silly
    * Use new man2-man8 helpers
    * Remove "FileUtils." since it is included in Formula
    * Use real names for deps instead of aliases
    * ENV.x11 now updates path, so remove that from individual brews

commit 7cff1940d313e93f8207276ca1def326d4112383
Author: Adam Vandenberg <flangy@gmail.com>
Date:   Wed May 19 08:02:20 2010 -0700

    readline 6.0.5

commit 6e0d5b4230826f8010c101cb965d1fbd7a935972
Author: Adam Vandenberg <flangy@gmail.com>
Date:   Tue Apr 6 09:28:57 2010 -0700

    Build readline as universal; more useful that way.

commit 5cfb353f80d3716033b79e431603af9ae766845a
Author: Adam Vandenberg <flangy@gmail.com>
Date:   Wed Mar 17 09:29:49 2010 -0700

    Add a --universal option to readline.

commit 63de494119a457c04bad00d931155ead7cb0ba39
Author: Adam Vandenberg <flangy@gmail.com>
Date:   Thu Dec 10 14:55:24 2009 -0800

    Use --enable-multibyte in Readline.

commit a82e823935e9c4092000bab57d1a6f1cae481dca
Author: Max Howell <max@methylblue.com>
Date:   Thu Oct 15 09:07:12 2009 +0100

    s/require 'brewkit'/require 'formula'/g
    
    brewkit.rb changes ENV destructively, so lets not do that everytime a formula
    is required. Now it's possible for other tools to require a formula
    description without worrying about side-effects.

commit 07b8bb7cc5d5d8ff13450c354d80a3194eb5fd7a
Author: Max Howell <max@methylblue.com>
Date:   Fri Sep 25 13:43:45 2009 +0100

    Fix readline
    
    Patches were level 0, not level 1

commit 10b1f9404c37f87a73bacf32b9ac91a5f7442653
Author: Max Howell <max@methylblue.com>
Date:   Tue Sep 22 16:13:26 2009 +0100

    Fix readline on Snow Leopard
    
    The patches broke the build.

commit aa34166af85939e35481f8ef856574cc52a8fa70
Author: Miikka Koskinen <miikka.koskinen@vapaus.org>
Date:   Tue Sep 22 16:48:59 2009 +0300

    Add missing end to readline formula.

commit 28f045d5b3fb5f3c754188afd60670ad37bd84db
Author: Adam Vandenberg <flangy@gmail.com>
Date:   Mon Sep 21 11:38:24 2009 -0700

    Apply patches to readline 6.0

commit 6786e52811d39afa6e3a24b099f631b4eaae2da2
Author: Max Howell <max@methylblue.com>
Date:   Mon Sep 21 20:22:09 2009 +0100

    Automatically add keg_only? deps to relevent ENV
    
    Eg gettext gets added into LDFLAGS, INCLUDE and that. I hope I got everything
    that is typical. Prolly not. But we'll find out.
    
    Made readline keg_only because the BSD version is provided by OS X, and I
    don't want bug reports that are tricky to solve due to unexpected differences
    between the two.

commit 6bb92434fa5bc8dc30b07419c43fd986fd3b5431
Author: Clinton R. Nixon <crnixon@gmail.com>
Date:   Thu Sep 10 17:56:07 2009 -0400

    Readline 6.0

commit af21407fec7f7dd37b43a0734c9ab5e55872c1e5
Author: Adam Vandenberg <flangy@gmail.com>
Date:   Mon Aug 3 12:01:41 2009 -0700

    Revert readline to version 5.2, but add patches
    
    This is because Python 2.6 needs this. As soon as something needs readline 6,
    we need to support both, which of course we can :)

commit d21205067c2a77555f51f1ab74aa75d8092c3cae
Author: Max Howell <max@methylblue.com>
Date:   Fri Aug 7 15:41:43 2009 +0100

    Apply new ENV capabilities to all existing Formulae

commit 82e1688028a64471bd16870354990e5618c560e5
Author: Max Howell <max@methylblue.com>
Date:   Sat Aug 1 19:44:16 2009 +0100

    Added Readline formula; updated Python formula.