Last active
October 10, 2015 18:18
-
-
Save taiki45/3731452 to your computer and use it in GitHub Desktop.
Ruby install 覚え書き
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ruby install 覚え書き | |
# gcc make gcc-c++ zlib-devel httpd-devel openssl-devel curl-devel libreadline-dev readline-dev あたりがはいっているか確認 | |
# install rbenv | |
$ cd | |
$ git clone git://github.com/sstephenson/rbenv.git .rbenv | |
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bashrc | |
$ echo 'eval "$(rbenv init -)"' >> ~/.bashrc | |
$ source ~/.bashrc | |
# install ruby-build | |
$ mkdir -p ~/.rbenv/plugins | |
$ cd ~/.rbenv/plugins | |
$ git clone git://github.com/sstephenson/ruby-build.git | |
# install Ruby | |
# リストを見る | |
$ rbenv install -l | |
# とりあえず 2.0.0- を入れる. パッチレベル深いものを. | |
# 並列処理させたいなら N を同時処理数に置き換え | |
# MAKE_OPTS="-j N" rbenv install 2.0.0-p247 | |
## with Readline support | |
# Homebrew の場合 brew install readline の後 | |
# CONFIGURE_OPTS=--with-readline-dir=`brew --prefix readline` rbenv install 2.0.0-p247 | |
# Macports の場合 sudo port install readline の後 | |
# CONFIGURE_OPTS="--with-readline-dir=/opt/local" rbenv install 2.0.0-p247 | |
# 基本はこのコマンド | |
$ rbenv install 2.0.0-p247 | |
# オプションつける例: | |
$ CONFIGURE_OPTS="--with-readline-dir=/opt/local" MAKE_OPTS="-j4" rbenv install 2.0.0-p247 | |
# 自分が使う Ruby を 2.0.0 に | |
$ rbenv global 2.0.0-p247 | |
# このままだとコマンド付きの gem を入れた時に | |
# "rbenv rehash" が必要でアレなので | |
# rbenv-rehash という gem を入れる | |
$ gem i rbenv-rehash | |
# 参考 | |
# https://github.com/sstephenson/rbenv | |
# https://github.com/sstephenson/ruby-build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment