Skip to content

Instantly share code, notes, and snippets.

@knsh14
Last active December 24, 2015 12:09
Show Gist options
  • Save knsh14/6795774 to your computer and use it in GitHub Desktop.
Save knsh14/6795774 to your computer and use it in GitHub Desktop.

前提

  • OS
    • ubuntu 12.04
  • ruby
    • 入ってない
  • そのほか
    • 基本的になにもそろってない

準備

% sudo apt-get install git make
% sudo apt-get install curl g++
% sudo apt-get install zlib1g-dev libssl-dev libreadline-dev libyaml-dev libxml2-dev libxslt-dev
% sudo apt-get install sqlite3 libsqlite3-dev
  • Macの人はlibsslの代わりにopensslでいいです.

rbenv インストール

% cd
% git clone git://github.com/sstephenson/rbenv.git .rbenv
% echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrc
% echo 'eval "$(rbenv init -)"' >> ~/.zshrc
% exec $SHELL
  • bash,その他のシェルの人は任意のシェル設定ファイルに書き直してください

ruby-buildインストール

% mkdir -p ~/.rbenv/plugins
% cd ~/.rbenv/plugins
% git clone git://github.com/sstephenson/ruby-build.git
  • ruby-buildをアップデートするには以下のコマンド
% cd ~/.rbenv/plugins/ruby-build/
% git pull
% sudo ./install.sh

Ruby本体をインストール

  1. リストを見る
% rbenv install -l
  1. ruby~となっているものをインストールして有効化する(今回は2.0.0-p247)
% rbenv install 2.0.0-p247
% rbenv rehash
% rbenv global 2.0.0-p247
  1. いろいろ入れるたびにrbenv rehashするの面倒なのでしないようにする
% gem i rbenv-rehash

おしまい

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment