Home > Open Source Development > Your first Ruby on Rails Application

Your first Ruby on Rails Application

The following is an example of how to create a simple ruby on rails application, on a Ubuntu development machine, push it to GitHub source control, and to Heroku for cloud hosting.

Here is the build of tools on my virtual machine:

  • Ubuntu 12.04 LTS
  • Git v
  • Rails v 3.2.3
  • Sublime Text 2 Build 2195

Part 1
mkdir code
rails new app1
cd app1
rails g scaffold post title text:text
rake db:migrate

Part 2

subl Gemfile
[add the following to file]
group :production do
gem 'pg'
group :development, :test do
gem 'sqlite3'
gem install pg
bundle install
[create 'app1' repository at github.com]
git init
git add .
git commit -m "baseline"
git remote add origin git@github.com:stevenfowler/app1.git
git push -u origin master

Part 3

heroku create -s cedar
git push heroku master
heroku run rake db:migrate
heroku open

  1. kiran
    May 17, 2012 at 3:03 pm

    awesome tutorial!
    keep up the good work.

  2. October 3, 2013 at 1:53 am

    Great tutorial. Couldn’t find your other rails tutorials, however would be thankful if you could send me their links.

  3. July 3, 2014 at 10:47 pm

    i love you for making this – i know i am a couple years out but i had a great time running through this tutorial 🙂

  4. Sara
    July 24, 2014 at 12:36 pm

    Is there a tutorial before this one on how to set up the environment for rails?

    • July 26, 2014 at 10:26 am

      There are other YOUTUBE videos out there for basic Linux installations.

  5. December 27, 2014 at 8:45 am

    Steven, I’m new to Ruby and like your teaching style. Will you be making any other Ruby tutorials in the future?

  6. runycalmera
    January 28, 2015 at 6:58 am

    Thanks for your post on rails, git And heroku.

    How did you install virtual box and do you use vagrant? I have trouble getting my machine working on mac.

    Where are your next videos on styling of the App you built?

  7. runycalmera
    January 28, 2015 at 7:00 am

    Where are your next videos????

  8. Dunya
    March 11, 2015 at 4:55 pm

    when I do Subl Gemfile
    this happens:
    No command ‘subl’ found, did you mean:
    Command ‘subs’ from package ‘libsubtitles-perl’ (universe)
    Command ‘publ’ from package ‘atfs’ (universe)
    subl: command not found

    what should i do???????????

  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: