LoginSignup
2
4

More than 5 years have passed since last update.

【Mac】〜環境構築〜Ruby編

Last updated at Posted at 2017-08-10

前提編が終わっていることが条件です。
Homebrewのインストールが終わってない方は、 前提編を参考にインストールしてください。

1. Homebrewをアップデートする。

$ brew update

2. rbenvをインストールする。

$ brew install rbenv ruby-build

3. rbenvがインストールできているのか確認する。

$ rbenv --version

バージョンが出てきたらOK。

4. PATHを指定

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

5. インストール可能なRubyを確認する。

$ rbenv install -l

6. Rubyをインストールする。

$ rbenv install ◯.○.◯

◯.○.◯には、工程4で確認したリストで表示されたバージョンを記入してください。

7. 使用するRubyのバージョンを指定する

グローバルでバージョン指定する場合。

$ rbenv global ◯.○.◯

ローカルでバージョン指定する場合

$ rbenv local ◯.○.◯

◯.○.◯には、工程5でインストールしたバージョンを記入してください。

8. Bundlerをインストール

$ gem install bundler

ローカル環境を汚さないためにもgemはBundlerで管理してください!

2
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
4