Rails #1b: Heroku

If you though getting started with Rails seemed easy from my first post, you haven’t tried out Heroku yet. Heroku is a hosted solution for Rails that comes with a browser based IDE. There’s nothing to install. It is so easy that it’s almost ridiculous. To me, this is the future of application hosting.

One of the remarkable things about Rails is that it lets you get up and running very quickly. Here is what you need to do to get your first application up and running on Heroku.

  1. Apply for an account on heroku (or mail me for an invitation)
  2. When you have gotten your account set up, go to the heroku page for your applications and log in.
  3. Press the big button labeled “Create New App”
  4. Click the button that look like a gear in the lower left hand corner and choose “generate” from the pop-up menu.
  5. Enter scaffold article title:string author:string content:text and click “run”
  6. Press the yellow text labeled “Migrate now” to create the articles table in the database
  7. (Optional) Select “rake” from the gear pop-up menu and type test
  8. (Optional) In the “rake” window, type db:fixtures:load to populate the database with test data
  9. Press the button with two right arrows (“>>”) on the top right corner and you will be taken to your application, done being installed on the heroku server. Add /articles to the url to see your newly generated application
  10. You can now play around with creating, retrieving, updating and deleting articles
  11. Click the button with two left arrows (“< <") on the bottom of the screen to return to the IDE
  12. (Optional) Make the application publicly available. Click the name of the application (“unnamed-xxxx” on the top left corner). Pick a name for your application, select “Public” to have it deployed to the net, and press rename

You now have a fully working, running, deployed Rails application. It requires no installation on your part. From here, you can follow the rest of my articles on Rails pretty much straightforward. Welcome aboard.

About Johannes Brodwall

Johannes is Principal Software Engineer in SopraSteria. In his spare time he likes to coach teams and developers on better coding, collaboration, planning and product understanding.
This entry was posted in Ruby-on-Rails, Technology. Bookmark the permalink.

13 Responses to Rails #1b: Heroku

  1. Just a tiny beware on outsourcing to EC2 in case you need more than 4 nines of uptime on your rails app.

  2. Just a tiny beware on outsourcing to EC2 in case you need more than 4 nines of uptime on your rails app.

  3. At the end of step five it says “Generate”. Should that be “Run”?

    5. Enter scaffold article title:string author:string content:text and click “generate”

  4. Hi Suezanne.

    Yes, you're right. I've corrected the article. Thanks for the catch.

  5. At the end of step five it says “Generate”. Should that be “Run”?

    5. Enter scaffold article title:string author:string content:text and click “generate”

  6. Hi Suezanne.

    Yes, you’re right. I’ve corrected the article. Thanks for the catch.

  7. eve isk says:

    I'd be more than happy to read drafts, run through example code, and whatnot. I've done a little bit of Rails work, but I'm enough of a noob that I'll be able to give good feedback on the clarity of the guide from the perspective of someone who has no real idea what he's doing.

  8. jhannes says:

    Hi, Eve

    Thanks for the offer. Let me know if there's any way I can make it easier. Do you think I should consolidate all the articles into one, for example?

  9. Unlockiphone says:

    Actually i already received an invite a while ago. But thanks for the offer. :)

    As for running RailsCollab on it, make sure all the necessary gem's are installed. You might also have an issue with gd2, which is used to resize images for the company logo's and user avatar's – which you can disable quite easily by commenting out the relevant code.

  10. MikeCrabe says:

    I think it would be great if you could write one.

  11. Tom says:

    Thanks for this great tutorial mate

  12. HIPS says:

    By far, Heroku is the most amazing web app I have used in the past year [maybe ever!] and I look forward to new developments.

    If there is anything I can do to help [other than continuing to spread the word], please let me know.

  13. SAP says:

    This is really a nice app.I enjoyed using this. Thank you for sharing the knowledge with us.

Comments are closed.