So, I’m finally diving into Ruby on Rails. The transition to Ruby on Rails from using CakePHP is going fairly smoothly. Now that I am really comfortable with the MVC framework that CakePHP uses, the learning curve has been pretty minimal.
My web hosting provider offers Ruby on Rails support, but I don’t like editing files directly on a server, so I decided to get things running locally on my own machine. It has been kind of a headache to get things working with FastCgi. Without FastCgi, everything runs pretty slow. With fcgi support, it runs really fast, which is nice. Just remember that you must restart Apache after you change your database.yml file.
If you want to start developing on Rails, I suggest following the WARR (Windows Apache Ruby on Rails) setup instructions. These instructions finally got my fcgi to work. You don’t have to put things in the directories that the tutorial suggests, especially if you are already set up with apache, mysql, etc.
If you want to learn some of the basics on Ruby, I suggest the following sites:
- Try Ruby – This site lets you type ruby commands into a little console in the browser window. No installation needed, just a browser. Follow their tutorial! It gives a pretty good, quick run-through of Ruby programming principles.
- Why’s (Poignant) Guide to Ruby – This is an online book that is an easy read.
If you’re looking for some good Rails tutorials check out:
- OnLamp.com RoR Tutorial – A good introductory tutorial. This was the first Ruby on Rails tutorial I ever completed.
- OnLamp.com RoR Tutorial II – A continuation on the other tutorial.
If you really want a good understanding of Ruby on Rails, and Ruby, I suggest buying these books:
- Agile Web Development with Rails – This is a good book whether you’re learning Rails or another inspired framework such as CakePHP. It was written by David Heinemeier Hansson, who is one of the master minds behind Rails and is on the 37Signals team. All parts of the MVC framework are discussed thoroughly in this book, and it has the best explanations for Model relationships such as Belongs To, Has One, Has and Belongs To Many. This book is awesome.
- Programming Ruby – This is an in depth guide to Ruby programming. It covers the basics all the way to the advanced features such as distributing Ruby objects across several processes and servers, much like Java’s RMI or CORBA. It is written by Dave Thomas (not the Wendy’s guy) who is also a co-author of the Agile Web Development with Rails book.
So, now I’m off and running, or at least jogging, with Ruby on Rails. Ruby is a really cool programming language. A lot of stuff seems backwards from what I’m used to with languages such as Java or php, but the differences actually make Ruby super elegant. It will take me a while to become super proficient in it, but I’m on my way.
I’ve already noticed some differences between Ruby on Rails and CakePHP, which I’m taking note of. I’ll write again soon with a detailed comparison of CakePHP and Ruby on Rails.