Created
September 9, 2016 09:14
-
-
Save yn-misaki/0aa1cf604360c199dde8a0f16fe7d6c0 to your computer and use it in GitHub Desktop.
rubyを超高速でインストールする方法 ref: http://qiita.com/yn-misaki/items/23ff4e0f1268511aed41
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
# rbenv+ruby-buildでインストール | |
$ rbenv install 2.2.4 | |
# rbenv+ruby-buildでインストール(rubyのドキュメントをインストールしない) | |
$ CONFIGURE_OPTS="--disable-install-rdoc" rbenv install 2.2.4 | |
# rbenv+rubyをソースからビルド(rubyのドキュメントをインストールしない) | |
$ sh ruby_install.sh | |
# ruby_install.sh という名前のシェルを作ります。↓中身はこちら | |
================================================================== | |
#!/bin/sh | |
curl -O https://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.4.tar.bz2 | |
tar jxvf ruby-2.2.4.tar.bz2 | |
cd ruby-2.2.4/ | |
./configure --disable-install-doc --prefix=$HOME/.rbenv/versions/2.2.4 # rbenvで使えるように、rbenvのversions配下にインストールする設定をする | |
make -j 2 # 【並列化】今回はマシンのコア数が2なので2を指定します。 | |
sudo make instal | |
================================================================== | |
# パッケージ化されたrubyを使ってインストール | |
$ sudo yum install -y | |
https://github.com/feedforce/ruby-rpm/releases/download/2.2.4/ruby-2.2.4-1.el7.centos.x86_64.rpm |
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
# OS | |
$ cat /etc/redhat-release | |
CentOS Linux release 7.2.1511 (Core) | |
# memory | |
$ cat /proc/meminfo | grep Total | |
MemTotal: 1884064 kB | |
# core数 | |
$ cat /proc/cpuinfo | grep "processor" | wc -l | |
2 |
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
$ git clone https://github.com/rbenv/rbenv.git ~/.rbenv | |
$ cd ~/.rbenv && src/configure && make -C src | |
# 設定の書き込み・反映(今回は、~/.bash_profileに書き込みます) | |
$ echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile | |
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile | |
$ source ~/.bash_profile |
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
$ git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment