0
3

More than 5 years have passed since last update.

Docker + Ruby on Railsの開発環境作成の最短構成

Last updated at Posted at 2017-06-09

dockerのインストールが終わっている前提

# コンテナを作る。
$ docker pull ruby:2.4.1
$ docker run -it -v /PATH/TO/LOCAL/RAILS_DIR:/usr/src/rails_app -w /usr/src/rails_app -p 3000:3000 ruby:2.4.1 /bin/bash

# 以下docker内部での作業
# 最近のrailsはnode必要だから、node入れる
apt-get update \
    && apt-get install -y --no-install-recommends \
        nodejs npm \
    && rm -rf /var/lib/apt/lists/*

npm install n -g
n stable


# 新規にrailsアプリを作る場合
gem install rails
gem new .
rails s -b 0.0.0.0

# すでにrailsアプリが作成済みの場合
bundle install
rails s -b 0.0.0.0

0
3
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
0
3