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 1.7.9.5
  • 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'
end
group :development, :test do
gem 'sqlite3'
end
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

    Steven
    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

    Steve
    Thanks.
    Where are your next videos????

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

    hi
    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 to Dunya Cancel reply