Help us understand the problem. What is going on with this article?

ubuntu + rbenvでrubyをインストール

More than 1 year has passed since last update.

はじめに

ubuntu14.04、rbenvを使ったrubyのインストール手順を記載。

  • ubuntu 14.04
  • git
  • rbenv
  • ruby-build
  • ruby

gitのインストール

sudo apt-get -y install git

gitがインストールされたか確認

git --version

rbenvのインストール

gitからclone

git clone https://github.com/sstephenson/rbenv.git ~/.rbenv

.bash_profileに設定を追記

echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.bash_profile
echo 'eval "$(rbenv init -)"' >> ~/.bash_profile

上記の設定を反映させるために再読み込み

exec $SHELL -l

rbenvがインストールされたか確認

rbenv -v

ruby-buildのインストール

ruby-buildとは、rubyをインストールするためのrbenvのプラグイン。
ruby-buildもgitからclone。

git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build

rubyのインストール

インストール可能なrubyのバージョンを確認

rbenv install --list

バージョンを指定してrubyをインストール&設定
(今回はバージョン2.4.0をインストール)

rbenv install 2.4.0
rbenv rehash
rbenv global 2.4.0

インストールされたかの確認は下記コマンド

rbenv versions
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
ユーザーは見つかりませんでした