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
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