Subscribed unsubscribe Subscribe Subscribe

MacBookで irb (Rubyコンソール) で日本語を使いたかったので 1.8.7 を入れる

Macrubyirb で日本語入力をできるようにする - Slow Dance
http://d.hatena.ne.jp/LukeSilvia/20080802/p1

Ruby 1.8.7ports で入れると、GNU Readlineという入力系のライブラリが更新して、問題が解消するとのこと。
(あ、Readlineだけ更新して様子をみてみればよかったです。)

$ sudo port install ruby +darwin_9 +mactk
Password:
--->  Fetching readline
--->  Attempting to fetch readline52-001 from http://ftp.gnu.org/gnu/readline/readline-5.2-patches/
--->  Attempting to fetch readline52-002 from http://ftp.gnu.org/gnu/readline/readline-5.2-patches/
--->  Attempting to fetch readline52-003 from http://ftp.gnu.org/gnu/readline/readline-5.2-patches/
--->  Attempting to fetch readline52-004 from http://ftp.gnu.org/gnu/readline/readline-5.2-patches/
--->  Attempting to fetch readline52-005 from http://ftp.gnu.org/gnu/readline/readline-5.2-patches/
--->  Attempting to fetch readline52-006 from http://ftp.gnu.org/gnu/readline/readline-5.2-patches/
--->  Attempting to fetch readline52-007 from http://ftp.gnu.org/gnu/readline/readline-5.2-patches/
--->  Attempting to fetch readline52-008 from http://ftp.gnu.org/gnu/readline/readline-5.2-patches/
--->  Attempting to fetch readline52-009 from http://ftp.gnu.org/gnu/readline/readline-5.2-patches/
--->  Attempting to fetch readline52-010 from http://ftp.gnu.org/gnu/readline/readline-5.2-patches/
--->  Attempting to fetch readline52-011 from http://ftp.gnu.org/gnu/readline/readline-5.2-patches/
--->  Attempting to fetch readline52-012 from http://ftp.gnu.org/gnu/readline/readline-5.2-patches/
--->  Attempting to fetch readline-5.2.tar.gz from http://ftp.gnu.org/gnu/readline
--->  Verifying checksum(s) for readline
--->  Extracting readline
--->  Applying patches to readline
--->  Configuring readline
--->  Building readline with target all
--->  Staging readline into destroot
--->  Installing readline 5.2.012_1
--->  Activating readline 5.2.012_1
--->  Cleaning readline
--->  Fetching ruby
--->  Attempting to fetch ruby-1.8.7-p72.tar.bz2 from http://www.ibiblio.org/pub/languages/ruby/1.8
--->  Verifying checksum(s) for ruby
--->  Extracting ruby
--->  Applying patches to ruby
--->  Configuring ruby
--->  Building ruby with target all
--->  Staging ruby into destroot
--->  Installing ruby 1.8.7-p72_2+thread_hooks
--->  Activating ruby 1.8.7-p72_2+thread_hooks
--->  Cleaning ruby

日本語でました。

bash-3.2$ ruby -v
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9]
bash-3.2$ irb
irb(main):001:0> puts '日本語こんにちは'
日本語こんにちは
=> nil
irb(main):002:0>