Ruby再インストール

OpenSSLとreadlineを含めたインストールをしていなかったので再度入れ直してみる。
というのは
Mac OSX Snow Leopard でRVMを使って1.8.7と1.9.xを共存 | Pistolfly
http://alifedesign.net/2012/06/irb%E3%81%A8pry%E3%81%A7%E6%97%A5%E6%9C%AC%E8%AA%9E%E3%82%92%E4%BD%BF%E3%81%86/
などで、OS標準のreadlineだとpryやirbで日本語が文字化けするとあったため。実際文字化けしていて鬱陶しいので。OpenSSLはついでです(いずれSSL絡んだスクリプトも作るかも知れないから)。

前準備

mini:~ admin$ brew install readline
Warning: readline-6.2.4 already installed
mini:~ admin$ brew upgrade readline
Error: readline-6.2.4 already installed

readlineは最新でしたw

mini:~ admin$ brew upgrade ruby-build
==> Upgrading 1 outdated package, with result:
ruby-build 20130518
==> Upgrading ruby-build
==> Downloading https://github.com/sstephenson/ruby-build/archive/v20130518.tar.
######################################################################## 100.0%
==> ./install.sh
🍺  /usr/local/Cellar/ruby-build/20130518: 79 files, 352K, built in 3 seconds
mini:~ admin$ brew install openssl
==> Downloading http://openssl.org/source/openssl-1.0.1e.tar.gz
######################################################################## 100.0%
==> perl ./Configure --prefix=/usr/local/Cellar/openssl/1.0.1e --openssldir=/usr
==> make
==> make test
==> make install MANDIR=/usr/local/Cellar/openssl/1.0.1e/share/man MANSUFFIX=ssl
==> Caveats
To install updated CA certs from Mozilla.org:

    brew install curl-ca-bundle

This formula is keg-only: so it was not symlinked into /usr/local.

Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.

The OpenSSL provided by OS X is too old for some software.

Generally there are no consequences of this for you. If you build your
own software and it requires this formula, you'll need to add to your
build variables:

    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include

==> Summary
🍺  /usr/local/Cellar/openssl/1.0.1e: 429 files, 15M, built in 3.3 minutes

Rubyインストール

参考:Home · rbenv/ruby-build Wiki · GitHub

$ rbenv versions
  1.9.3-p194
* 1.9.3-p392 (set by /Users/common/.rbenv/version)
  macruby-0.13

インストールされてるけど続ける?って言ってきますのでyで継続。

$ env CONFIGURE_OPTS="--with-readline-dir=`brew --prefix readline` --with-openssl-dir=`brew --prefix openssl`" rbenv install 1.9.3-p392
rbenv: /Users/common/.rbenv/versions/1.9.3-p392 already exists
continue with installation? (y/N) y
Downloading yaml-0.1.4.tar.gz...
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/common/.rbenv/versions/1.9.3-p392

Downloading ruby-1.9.3-p392.tar.gz...
Installing ruby-1.9.3-p392...
Installed ruby-1.9.3-p392 to /Users/common/.rbenv/versions/1.9.3-p392

rubygemsが残っているか確認。

$ gem list

*** LOCAL GEMS ***

bigdecimal (1.1.0)
 :
zipruby (0.3.6)

大丈夫でした。ではpryでの日本語入力確認。

$ pry
[1] pry(main)> print "日本語"
日本語=> nil

おkですね。