Getting Started with Ruby on Rails

by Dan Benjamin

28 Reader Comments

Back to the Article
  1. Im a designer/developer and have been working with ruby on rails for the past 2.5 years, its a wonderful platform to work off. I love the way the framework is organized, it keeps the code clean. Im getting better at writing actual ruby code, but I still have a long way to go. When I compared the rails framework to php frameworks such as zend, cakephp, and symfony, it seemed as though they were all just trying to copy rails. Which is in itself flattering! Go Rails!
    Copy & paste the code below to embed this comment.
  2. Hey Dan, thanks, especially for the PHP comparison. I admit I know very little about programming so it’s nice to know PHP isn’t “the debil” as lots of Ruby users might think. ;) Also, thanks for clarifying the fact that Rails is a _code_ framework and not a super pixie dust maker. Spending too much time talking to RoR guys and I start to believe -it- +I+ can do magical things. It’s like me telling a client “CSS is super easy, anyone can do it!” Even CSS is still code. You’ve made me appreciate developers so much more today, as though it were possible. ;) The trouble with making things _look_ easy is accidentally implying that anyone could do your job and that is just not so.
    Copy & paste the code below to embed this comment.
  3. after looking thru the previews of google app engine it looks like theyre going to be doing the MVC thing. i couldnt help but think that it was a rails killer after watching it. anyone else?
    Copy & paste the code below to embed this comment.
  4. Hey Dan, Great article. What are you using to make those nice red arrows on your screenshots? I have seen it elsewhere and its a really nice technique. Cheers,
    Alastair
    Copy & paste the code below to embed this comment.
  5. You compared Rails to PHP?  Shouldn’t that be a Ruby and PHP comparison? Why not mention fuller and more competent frameworks such as Symfony etc? “Symfony”:http://www.symfony-project.com
    Copy & paste the code below to embed this comment.
  6. bq. You compared Rails to PHP? Shouldn’t that be a Ruby and PHP comparison? Eugene, he explained that here: bq. “Technically speaking, we shouldn’t compare PHP, a programming language, to Rails, a web application framework. Instead, we should compare PHP to the Ruby programming language upon which Rails was built.”
    Copy & paste the code below to embed this comment.
  7. I think each language are good for different projects…
    Copy & paste the code below to embed this comment.
  8. This article is very good overview of the Rails framework, and was very useful to me.
    I am web develpoer and a not very experienced Java programmer, and I’m just beginning with Rails. The only one thing that, for me, you should say stronger, is that learning the Object Oriented programming principles is essential to make a decent use of Rails, and it can be very difficult for smart people too, and anyway it takes a lot of time.
    So I think that if you are a designer that can write some php or javascript but knows nothing about OO programming, or you plain to become a software developer (and invest about one year to learn it) or much better you forget Ruby and Rails.
    Copy & paste the code below to embed this comment.
  9. bq. after looking thru the previews of google app engine it looks like theyre going to be doing the MVC thing. i couldnt help but think that it was a rails killer after watching it. anyone else? Not really, the google app engine certainly has a huge advantage on Rails in the scalability department, but in other areas it won’t be able to match Rails’ flexibility.  At least not in the short term. If the google app engine does emerge as a market leader in web application development it will not be at the expense of Rails, but rather it will mark a paradigm shift and the decline of open source and self-hosted web applications.  That would be a dangerous development for the open nature of the web in general. However as far as Rails is concerned, it’s not particularly vulnerable for the time being.  Despite the brilliant marketing by David Heinemeier Hansson resulting in a widespread assumption that Rails is little more than a flavor-of-the-month fad, Rails’ continued success has been a result of well-conceived architecture embodying established best practices.  There’s nothing really new about Rails… it’s just pulling the best ideas from the last 10 years of web development and rolling them up in an agile package that tends to give you more bang for your buck than anything that came before.  Of course it can’t hold a candle to PHP for one-off dynamic additions to static pages, or to J2EE for interfacing with sprawling enterprise backends, but there’s a sizable sweet spot. Eventually best practices will evolve—due in no small part to the influence of modern frameworks such as Rails, Django and Seaside—and Rails will be superceded by something newer and less ossified.  However even Google is not capable of something that will blow Rails out of the water yet.
    Copy & paste the code below to embed this comment.
  10. Hello, This is one of the best introduction article i have read. It really promotes rails and makes it clear. A List Apart is very famous for CSS also. I would like to see few articles on mixing Great CSS styles with rails. Tabs, Sliding Doors, CSS Comments. Liquid and 3 column templates are few of articles which can be shown with rails. Rails can become more powerful with good CSS. Thanks SoftMind
    Copy & paste the code below to embed this comment.
  11. We’ve been using Zend Framework for the company that I work for. Though it’s still a bit immature, it’s incredibly robust, easy to understand, and certainly flexible.  ZF has everything I’ve ever needed.  My only complaint with RoR is the learning curve.  I just process/think that way.  Our company almost went the ROR direction (as well as Adobe’s Flex) but decided on ZF. Kudos to anyone who uses ROR, but Zend Framework speaks my language.
    Copy & paste the code below to embed this comment.
  12. bq. Technically speaking, we shouldn’t compare PHP, a programming language, to Rails, a web application framework. Instead, we should compare PHP to the Ruby programming language upon which Rails was built. Actually, since the article is about Rails, not Ruby, you should have compared CakePHP or Zend Framework to Rails. I know a comparison wasn’t the point of the article, but as a PHP programmer, I would have found that more useful than “Ooh, you can write the same for loop 2 different ways!”
    Copy & paste the code below to embed this comment.
  13. only gets mentioned once! So to set the record straight Perl also has excellent, modern MVC frameworks the best of which is Catalyst. http://catalyst.perl.org/ And of course, writing your app with perl not only means you can (re)use anything from CPAN (a *massive* free software repository compared to Rubys gems) you also have a large, friendly, responsive community to get you through your learning curve. Perl’s not dead it’s just very very stable and is well worth considering for any size website. It’s certainly worthy of a mention on ALA - where would you all be without CGI.pm ?  
    Copy & paste the code below to embed this comment.
  14. Thats a fantastic overview. Very clear and concise introduction to ruby Just what i needed to inspire me to go learn Ruby for myself.
    Copy & paste the code below to embed this comment.
  15. A List Apart came through at the right time for me. I was just thinking this week about how I’d like to learn more about RoR, and bam! Two complimentary articles. I’m completely inspired to go learn this language and framework.
    Copy & paste the code below to embed this comment.
  16. Drupal is a CMS written in PHP. It has many great modules, that do almost anything you want. Yet, almost always, you want that one thing which doesn’t exist yet.
    So, you write a module, using some already supplied functions, from other Drupal modules, and voila - you have a whole new functionality.
    Can PHP on Drupal be considered as RoR - a language to write code, based on an already written code, in the same language?
    Copy & paste the code below to embed this comment.
  17. Its a nice overview about ruby. Honestly, this is the first nice Ruby overview that i’ve read
    Copy & paste the code below to embed this comment.
  18. Just wanted to add a comment on use of the editor for code development with Ruby and/or Rails. JEdit [www.jedit.org] is also a great free alternative to Textmate, when used with the free Ruby plugin and the ProjectViewer plugin.  The Ruby plugin gives you all the keyword hightlighting plus ruby and rails docs and a class structure browser which is great for navigating code. The ProjectViewer plugin gives you the folder view like Textmate and probably much more flexibility.  Each of these plugins gives you a dockable/collapsible window as well.
    Copy & paste the code below to embed this comment.
  19. For those of you who want a great way to get started in rails, Aptana IDE has a great development environment plugin for Rails developers.  They also have some great screencasts to get you started.  Aptana can be found at aptana.com and the screencasts are found at aptana.tv.  They have a great free version and a pro version you can upgrade to as well.  Aptana really helps you visualize the structure and debug your rails apps from within one common application.
    Copy & paste the code below to embed this comment.
  20. If anybody wants to have a go at Ruby on Rails without having to set it up, try “Heroku”:http://heroku.com. They host the application on Amazon’s ec2 hosting service. You can set up an application with the click of a button and edit files in your browser - it’s brilliant! It’s just like google’s app engine, so I can’t see that killing off rails anytime soon. More likely that more and more sites will use elastic hosting that takes the pain out of deployment. DAZ
    Copy & paste the code below to embed this comment.
  21. Rails is powerful, but it is a coding framework. Not exactly the most natural solution for web designers. There are interesting stirrings in the Ajax community around creating visual, even WYSIWYG tools for building web apps. Examples include WaveMaker, Aptana, Bunkai. WaveMaker is open source, runs on Mac, Windows and Linux, available at www.wavemaker.com/downloads
    Copy & paste the code below to embed this comment.
  22. Your article is a good primer on the environment of Ruby on Rails, but I think you should point us in the direction of some more support resources. Many tutorials, and even the screencasts on rubyonrails.org, contain code that breaks or doesn’t work as of Rails 2.0. I would suggest pointing us towards a list of changes to watch out for, because it may stand in the way of many people, including myself.
    Copy & paste the code below to embed this comment.
  23. I enjoy working with RoR, but I think there needs to be more emphasis on choosing to use it only when it’s right for the job. Dan did mention that he uses PHP on certain things, but I think it should be taken a little further than that.  Why?  Because there is so much RoR buzz going around that I have clients demanding Rails sites, regardless of the feature set or scope.  I’ve also seen some scalability issues with Rails that not many people are willing to address. Now, I’m not trying to discourage anyone from using Rails.  Just remember - you’re a craftsman.  Choose the right tool for the job!  If it happens to be Rails, then enjoy.
    Copy & paste the code below to embed this comment.
  24. I just entered the programming world and was looking at the different methods and your article is a great help on the front.

    Will definitely give ruby on rails a shot.
    Copy & paste the code below to embed this comment.
  25. Honestly, if it wasn’t for stumbling onto rails 3 or so years ago I’ve no idea what I’d be doing now. It’s not just that the coding style was a welcome relief from the Microsoft last I’d lived in for 10+ years, but that the community around it was much more interesting. The entire “ruby lifestyle” has significantly reduced my stress levels and made coding fun again.
    Copy & paste the code below to embed this comment.
  26. Stumbled across this article recently. I know I am late commenting! However, I just feel the distinction needs to be made between PHP4 and PHP5 when discussing PHP or even comparing it to other languages like Python, Ruby, Perl, etc. Given PHP’s complete overhaul of their object model with v5, PHP4 and PHP5 are basically two different languages meriting distinction. This also seems to be the case with every major version release of PHP. I feel the real comparison would have been RoR vs Django. Although I admit I am far more partial to Django and Python than RoR and Ruby. :) When it comes to PHP frameworks, out of the box, the standard is the Zend framework. Most of the other PHP frameworks are built on the PHP4 language and are flawed from the start as such. IMO, using v4, you are basically building a legacy application as you code! It’s unfortunate that PHP did not have a real, solid object model in v4. However, when it comes down to it, building an MVC framework can be done in any language (the design pattern has been around for decades now) and really is quite simple. A good exercise for any intermediate programmer is to build out your own MVC framework in your language of choice. At the very least, it will give you a solid understanding of what is actually going on underneath the hood of all these other frameworks even if you do not fully complete it. Nice article though, solid writing, very concise.
    Copy & paste the code below to embed this comment.
  27. Been using Ruby and ROR for nearly four years and it has gone from strength to strength. While there are a lot of ordinary articles which give an overview of Rails, this is a exceptionally article, and given that a lot has changed in last few years with Heroku, Rails 3, it might be a good idea to update this one. As for Stephen point about PHP4 vs PHP5, while it is true to some extent, in practical terms a lot of developers still use PHP as they always used to in PHP4. While technically it has a object model, the adoption percentage is still low.
    Copy & paste the code below to embed this comment.
  28. Hey thanks for this, just starting out on Ruby and this is a great place to start
    Copy & paste the code below to embed this comment.