LoginSignup
44
43

More than 5 years have passed since last update.

Vagrant(CentOS6.5)にRuby2.1.2 Rails4.1をインストール

Last updated at Posted at 2014-05-24

何番煎じかわかりませんが、自分への忘備録を兼ねて載せておきます。

Vagrant

  1. 作業ディレクトリの作成
    $ mkdir -p path/to/rails && cd path/to/rails

  2. Boxをダウンロード
    $ vagrant box add centos65box https://github.com/2creatives/vagrant-centos/releases/download/v6.5.3/centos65-x86_64-20140116.box

  3. マシンの初期化
    $ vagrant init centos65box

    A Vagrantfile has been placed in this directory. You are now
    ready to vagrant up your first virtual environment! Please read
    the comments in the Vagrantfile as well as documentation on
    vagrantup.com for more information on using Vagrant.

  4. マシンの起動
    $ vagrant up

Ruby 2.1.2

  1. rbenvのインストール
    anyenvを利用してインストールします。
    $ git clone https://github.com/riywo/anyenv ~/.anyenv
    $ echo 'export PATH="$HOME/.anyenv/bin:$PATH"' >> ~/.bash_profile
    $ echo 'eval "$(anyenv init -)"' >> ~/.bash_profile
    $ exec $SHELL -l
    $ anyenv install rbenv
    $ exec $SHELL -l

  2. Ruby 2.1.2のインストール
    $ rbenv install -v 2.1.2
    OpenSSLが入っていないと言われるのでインストール
    $ sudo yum -y install openssl openssl-devel
    ruby 2.1.2を標準に
    $ rbenv global 2.1.2

Rails 4.1

  1. gemを最新に $ gem update --system
  2. Railsのインストール $ gem install rails --no-ri --no-rdoc -V
  3. 反映 $ rbenv rehash
  4. version確認 $ rails -v
    Rails 4.1.1
44
43
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
44
43