Getting Started with Rails…the quick ‘n easy way

Why and how to use Rails in a cloud based development environment with cloud9…

If you have a non-unix environment or in my case a not so compatible version (fedora), the quickest way to start developing (that I know about) is the use of a cloud development environment such as Cloud9

Cloud9 combines a powerful online code editor with a full Ubuntu workspace in the cloud.

And, there’s a free plan (forever, supposedly…)!

To run the example Rails app with MySQL in the default demo-project workspace (you can choose a Ruby workspace or Rails Tutorial workspace and skip these steps altogether !!!!), do the following

  1. Install MySQL gem with the following command:
$ gem install mysql2

2. Create empty database

$ mysql-ctl start

3. Install Rails gem

$ gem install rails

4. Create new rails project

$ rails new example -d mysql

5. Edit the file under the development section of the config/database.yml with the following:

adapter: mysql2
encoding: utf8
database: c9
username: <%=ENV['C9_USER']%>
host: <%=ENV['IP']%>

6. Start the server/launch application

$ rails s -b $IP -p $PORT

References:

Running a Rails App

Setting up MySQL

Piece of Cake, right?

Best Coding,

SVC