LoginSignup
6
1

More than 5 years have passed since last update.

rails5 環境構築 メモ

Last updated at Posted at 2016-11-14

rails5系とnode6系を入れる必要があったのでメモ程度に。

rails

rbenvとruby-buildのインストール

$ brew install rbenv ruby-build

ruby-buildでrubyのいろいろなバージョンのインストール、rbenvでrubyのバージョンの切り替えができる。

rbenvのpathを通す

$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
$ source ~/.bash_profile

rbenvのpathを通します。使っているシェルに応じてよしなにしてください。

日本語使いたい人はreadline

$ brew install readline
$ brew link readline --force

rubyのインストール

$ RUBY_CONFIGURE_OPTS="--with-readline-dir=$(brew --prefix readline)"
$ rbenv install 2.3.1

v2.3.1を入れましたが他のバージョンが良い人は rbenv install -l の中からお好きなものを。

rubyのバージョンの切り替え

$ rbenv global 2.3.1
$ ruby -v

rubyのバージョンをインストールしたものに変更。
変更したバージョンが返ってこれば成功ですね。

railsのインストール

$ gem install rails
$ rails -v

railsのインストール。
こちらもバージョンが返ってこればおk。

node

nodebrewのインストール

curl -L git.io/nodebrew | perl - setup

nodebrewで入れようかと思います。

nodebrewのpathを通す

$ echo 'export PATH=/usr/local:$PATH' >> ~/.bash_profile
$ echo 'export PATH=$HOME/.nodebrew/current/bin:$PATH' >> ~/.bash_profile
$ source ~/.bash_profile

nodeのインストール

$ nodebrew install-binary v6.0.0

v6.0.0を入れましたが他のバージョンが良い人は nodebrew ls-remote の中からお好きなものを。

nodeのバージョン切り替え

$ nodebrew use v6.0.0
$ node -v

インストールしたバージョンが返ってこれば成功です。


Happy Hacking!!

6
1
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
6
1