Rails Developement env

Ruby Linux, Mac

Instruction is RVM


Install rvm

RVM is Ruby version management tool.
You can use several version in rvm.
If you want to use several version of Ruby etc 1.9, 2.0, ….
In this case, rvm is useful for you.

curl -L https://get.rvm.io | bash -s

This is same as Mac and Linux. this URL is UNIX script


Install stable

rvm get stable


Install requirements

Install other softwares which is required rvm

rvm requirements

Install several softwares for rvm

Add rvm PATH automatically in .bash_rc
If missing, you need add rvm path to PATH

Install Ruby

2.0

rvm install 2.0.0 --with-openssl-dir=$HOME/.rvm/usr  # Ruby 2.0

2.1.2

rvm install 2.1.2 --with-openssl-dir=$HOME/.rvm/usr  # Ruby 2.1.1

Switch login shell

In Ubuntu, you need to switch login shell to use Ruby and rvm

/bin/bash --login

※ Ubuntu 13.10
In 13.10, default ruby is 1.9 or 1.8.3

Switch Ruby version in rvm

rvm --default use 2.1.3
ruby -v

Ruby gems check

which gem

If you install rvm, gems should be installed


Install rails

Next is install rails using gem

gem install rails --version 4.1.0

Install 4.1.0 in this case.
You don’t need to add version

gem install rails

Gem setting no doc

Edit .gemrc

install: --no-rdoc --no-ri
update:  --no-rdoc --no-ri

Checks

Create blank application

rails new sampleapp
cd sampleapp
rails s

And access http://localhost:3000

If something wrong, you need some packages
In my case, nodejs is required

sudo apt-get install nodejs

If you have bundle install error, you need to install package using gem

gem install packagename