1. Update the System and Install Common Software
On Ubuntu, run sudo apt-get update
|
|
Install MySQLsudo apt-get install mysql-server mysql-client libmysqlclient-dev
Set a password when prompted
2. Install rbenv
rbenv is a Ruby version manager built by Basecamp (formerly 37signals). It makes it easy to set Ruby versions for development, testing, and production. A similar, older tool is RVM. I chose rbenv because it's simpler, powerful, and focused.
Clone rbenv into .rbenv
git clone https://github.com/sstephenson/rbenv.git ~/.rbenvAdd ~/.rbenv/bin to your $PATH
echo 'export PATH="$HOME/.rbenv/bin:$PATH"' >> ~/.zshrcAdd
rbenv initto your shellecho 'eval "$(rbenv init -)"' >> ~/.zshrcRestart your shell and check whether the installation worked
type rbenv=> # "rbenv is a function"Install ruby-build.
Note: .zshrc is the zsh config file. If you use bash, use ~/.bashrc instead.
3. Install Ruby
Now you can install a specific Ruby version and set it as the global version
|
|
Run ruby -v to check the Ruby version you set
4. Install Rails
Once Ruby is installed, gem is available, so you can install Railsgem install rails -v 4.1.2rails -v
Check the Rails version
And that's it: Ruby on Rails is installed.
Notes:
OS: Ubuntu 14.04 x64
Ruby: 2.1.2
Rails: 4.1.2
