jubilee

Programing, Books and more...

Octopressブログ環境の再構築:第2回

前回はHomebrewのインストールまでだったので、続きから。
Rubyのバージョン管理を行うrbenvやその他必要モジュールをインストール。

  1. Homebrewのインストール
  2. rbenvのインストール <– いまここ
  3. Ruby1.9.3のインストール
  4. SSH鍵の設定(GitHub, Bitbucket)
  5. Octopressブログ環境の構築(From Bitbucket)

readline

Rubyが使用するライブラリで、コマンドラインの1行入力をサポートするライブラリ。

1
2
3
4
5
6
$ brew install readline
...
LDFLAGS:  -L/usr/local/opt/readline/lib
CPPFLAGS: -I/usr/local/opt/readline/include
==> Summary
🍺  /usr/local/Cellar/readline/6.2.4: 31 files, 1.6M

openssl

Rubyが使用するライブラリ。
SSL(Secure Socket Layer)は、ネットワーク通信を暗号化するライブラリで、OpenSSLはそのオープンソースの実装。

1
2
3
4
5
6
7
8
9
10
$ brew install openssl
...
    LDFLAGS:  -L/usr/local/opt/openssl/lib
    CPPFLAGS: -I/usr/local/opt/openssl/include

==> security find-certificate -a -p /Library/Keychains/System.keychain > '/usr/local/etc/openssl/osx_cert.pem.tmp'
==> security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> '/usr/local/etc/openssl/osx_cert.
==> mv -f /usr/local/etc/openssl/osx_cert.pem.tmp /usr/local/etc/openssl/osx_cert.pem
==> Summary
🍺  /usr/local/Cellar/openssl/1.0.1f: 429 files, 15M

rbenv

Rubyのバージョン切り替えを行えるパッケージ。

1
2
3
4
5
6
7
8
9
10
$ brew install rbenv
...
==> Caveats
To use Homebrew's directories rather than ~/.rbenv add to your profile:
  export RBENV_ROOT=/usr/local/var/rbenv

To enable shims and autocompletion add to your profile:
  if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
==> Summary
🍺  /usr/local/Cellar/rbenv/0.4.0: 31 files, 152K, built in 2 seconds

.bash_profile

rbenvをインストール時に表示されたスクリプトを.bash_profileに追加。

1
2
3
4
5
6
$ vim ~/.bash_profile
...
// rbenv(to enable shims and autocompletion)
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
...
$ source ~/.bash_profile

ruby-build

rbenvを使用してRubyをインストールするためのパッケージ。

1
2
3
4
5
6
7
$ brew install ruby-build
...
==> Installing ruby-build
==> Downloading https://github.com/sstephenson/ruby-build/archive/v20140214.tar.gz
######################################################################## 100.0%
==> ./install.sh
🍺  /usr/local/Cellar/ruby-build/20140214: 108 files, 472K, built in 2 seconds