Cookies setting

RoR for n00bs

After making this page in rails, I’ve decided to give something back. This is not one of the thus dozen Rails tutorials for beginners, that are all the same. I just want to point in the right directions to help make the learning process as painless as possible. Particularly for those like me, who’ve decided to be hardcore and develop on Windows.

Why Ruby (on rails)?
Ask Google and you’ll get tons of arguments. For me is the simplicity, the DRY »Don’t Repeat Yourself« philosophy (that I don’t yet fully practice) and the predefined organization of all the elements.
For those who’ve never done any web development, it’ll probably be very easy to learn. On the other hand, for someone who has been already programming for years, it can be a bit confusing, as it is totally object oriented and very abstract.

Where to start?
Rails Guides is the best place to start. There is all you need to know to start developing with Rails. The most important thing is that it gets updated constantly. A Google search will give you a lot of rails tutorials that are outdated and probably don’t work in the new versions without a few changes, which can be very frustrating for a beginner. A good practice is to always look at the date of the article first.
Then you continue with
Railscasts and RailsLab awesome screencasts. There are other pages that offer screen casts for money, which I won’t mention, because I think ignorance can be a person’s biggest weakness and knowledge should be free.
For your gem needs use
GitHub, on which you can learn a lot on the pages mentioned above (sadly, due to lack of time, I haven’t yet mastered GitHubs full potential).

Here are some links that may be also useful:


And of course Google is always your friend!


The console:
RoR is a script based language, that needs you to use the console a lot. Which makes it perfect for Unix based OSs. On Windows the philosophy is all about the UI and the console is, let’s face it, crap. To survive is necessary to use at list the Windows PowerShell (preinstalled on Windows 7) or some third party console application, like the one named Console.

The editor:
If you are a masochist, you can always use just the notepad and skip this part.
 There are many text editors out there and more and more are starting to support ruby. I won’t list them all, everybody should try some and chose the more suitable to their needs. Here is a good list of some of them on the Rails Wiki
If free is what you want, NetBeans is in my opinion the way to go. It’s an IDE so you won’t need to go to the console so often. There are also many good tutorials on the NetBeans page .
If money is not an object or you are willing to spend some on a text editor, your best choice on Windows is in my opinion RubyMine. A RoR IDE that has all you need, even full haml/sass support (What is this? Read a few paragraphs down). With this I use the console just to install some gems and run them (if needed).

The database:
The easiest choice is the default Sqlite, because everything just works practically out of the box. With MySQL on Windows x64 I had some difficulties, because there wasn’t a gem for the 64bit version of MySQL or something. That could’ve been fixed by now, but why go thru the trouble, when you have a very good default solution.

I call
haml/sass “The Nazi versions of html/css”. They are strict, organized and very readable. It’s based on the philosophy “Markup should be beautiful” and it really is. It’s confusing at first, but after 10 minutes you’ll not be able to live without it and writing normal html/css will be a big pain in the ass.



Some other gems that may be useful:


  • Compass: You’ll want to have your page in a nice and practical grid.
  • Haml-scaffold: With this the blog tutorial “Creating a weblog in 15 minutes with Rails 2” is done even quicker and includes all the futures you’ll need (like pagination and obviously haml/sass).
  • Will_paginate: Pagination that just works. It is as simple as can be.
  • Paperclip: Grate file attachment library, that becomes a very powerful images uploader in combination with ImageMagick.
  • Easy-fckeditor: A JavaScript full featured text editor.



This are the main games that I used to build this site, for more gems obviously go to GitHub.


The JavaScript:
I was told that Prototype is good if you want to learn JavaScript and jQuery is good if you want something just work, without knowing how it’s actuality done. After working with Prototype for a while, I haven’t learned much and I got frustrated a lot. I got even more frustrated, once I started to use jQuery and I’ve done the same things in no time, with no issues at all. Prototype is the default JS library on RoR, I advice if you are not very familiar with JS switch to jQuery.

In conclusion…
I hope that this collection pointers and personal experiences about RoR can be useful to someone. If you have something to add on the subject, leave a comment below.

29 Apr 2010 at 20:38