LoginSignup
2

More than 5 years have passed since last update.

rails インストール (CeontOS)

Posted at

はじめに

下記のものを入れておく

  1. git
  2. rbenv
  3. ruby-build
  4. ruby

[参考] http://qiita.com/inouet@github/items/478f4228dbbcd442bfe8

1. gem のアップデート

$ gem update --system

2. bundler のインストール

$ gem install bundler --no-ri --no-rdoc
Fetching: bundler-1.3.5.gem (100%)
Successfully installed bundler-1.3.5

忘れずに

$ rbenv rehash

3. rails のインストール

$ mkdir ~/my_rails_app
$ cd ~/my_rails_app
$ bundle init

Gemfile ができる

Gemfile 編集

$ vim Gemfile

source "https://rubygems.org"
gem 'rails', '~> 4.0.0'

$ bundle install

3. 確認

$ rails -v
Rails 4.0.1

プロジェクト作ってみる

$ rails new test_app

いろいろファイルが作られる

WEBサーバ(WEBRic)を立ち上げて確認

$ cd test_app
$ rails server

JavaScript Runtime のエラーが出る場合は therubyracer を入れる。

Gemfile編集して

$ vim Gemfile
# gem 'therubyracer', platforms: :ruby <== このコメントを外す

インストール

$ bundle install

ブラウザでURLを叩いて Rails 画面が出ればOK

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