Skip to content

Instantly share code, notes, and snippets.

@edomaru
Last active October 28, 2018 15:31
Show Gist options
  • Save edomaru/f2fd5bbd1fe3129c48ad to your computer and use it in GitHub Desktop.
Save edomaru/f2fd5bbd1fe3129c48ad to your computer and use it in GitHub Desktop.
Install Rails 4.2 on Ubuntu 14.04 LTS

Install Rails 4.2

Before install Rails 4.2, we need to install node.js first

sudo add-apt-repository ppa:chris-lea/node.js
sudo apt-get update
sudo apt-get install nodejs

After node.js installed, we ready to install Rails

gem install rails -v 4.2.1

If install ruby with rbenv, we also call this command:

rbenv rehash

Check the rails install:

rails -v

We ready to use rails

rails new my_app
cd my_app
rails server

Install mysql (Optional)

sudo apt-get install mysql-server mysql-client libmysqlclient-dev

Here is example how create Rails app with mysql database

rails new my_app2 -d mysql

After that, configure config/database.yml according to mysql login user and we can create the database with this command:

rake db:create
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment