Rapid Ruby on Rails indoctrination
September 20, 2010 6:55 AM   Subscribe

At year's end, I'm transitioning to a new web dev department that uses RoR extensively. Problem is, I've been a PHP/mySQL guy my whole working life. Help me bone up on my RoR, stat!

So, all you RoR experts out there: pretend you're starting from scratch, with no prior Ruby or RoR experience. What would you do to get up to speed as quickly as possible. Here are some things to consider:

1. I'm near expert-level with PHP/mySQL, so programming isn't new to me.

2. It seems this is an ideal time to be asking this question since RoR 3.0 was just released. Should I focus primarily on 3.0 so I can be as relevant as possible, or do I need to backtrack and tackle one of the 2.* versions?

3. I'm not so naive to think that I can become a RoR whiz by Christmas. I realize that I won't be able to really hone my chops until I'm in the shit, working with the code every single day. I just don't want to be completely lost when they start throwing projects my way.

So, with those points in mind, where should I begin? Books, links, videos, online classes, whatever; lay it on me! The end goal is to be so saturated in RoR 3.0 that nothing will cross my desk that I can't tackle.

Thanks!
posted by (bb|[^b]{2}) to Computers & Internet (9 answers total) 16 users marked this as a favorite
 
This is a wonderful Ruby on Rails tutorial that comes in 2.3 and 3.0 flavors, and is free online. It is a great introduction to the whole suite of tools, and to the basic subset of Ruby that is really necessary for Rails development. But, it takes you through the whole process of building a simple user auth system in Rails so it's not a superficial taste, you really get a feel for it. It uses a TDD methodology which is not necessarily used everywhere, but is great to be familiar with even if not (and worth introducing to the environment if it isn't used, IMHO).
posted by dubitable at 7:02 AM on September 20, 2010 [1 favorite]


Seconding railstutorial.org. Also, it'd be worth checking out railscasts.com, although some of the tutorials will be less relevant now that Rails 3.0 is out.
posted by Alt F4 at 7:12 AM on September 20, 2010


A lot of the tutorials focus on the Rails side of things. Personally I had more trouble with the Ruby side, since it uses some weird constructs and I had trouble just reading the code. A beginner RoR person tends to write Ruby that looks like Perl or Python, and so do the tutorials, while the libraries and example code written by experts look like jibberish. This page is helpful.
posted by smackfu at 7:38 AM on September 20, 2010 [1 favorite]


I have been around several people who have made the transition to Ruby on Rails. I think its worthwhile to learn Ruby then add on Rails. I really like David Black's The Well Grounded Rubyist. I think its one of the clearer books about Ruby.

There is also Ruby Quiz, which is an archive of programming puzzles designed to be solved in Ruby.

As for versions, I would try to find out what versions the department you are going to be working in plans on using in December. Rails 3 has substantial differences from 2.3, and switching from one to the other is not unsubstantial. There's also a chance that the department is not yet using Ruby 1.9 (other popular versions are 1.8.6 and 1.8.7).
posted by miscbuff at 7:42 AM on September 20, 2010


The combinatorics of possible runtimes and rails versions this precise moment is a bit of a clusterfuck at the moment; you may find that a lot of tutorials right now do not work on Rails 3 and you will be stuck in a small world of pain.

If this is a fresh new project, starting it on Rails 3 will be desirable if only because it's enforcing a whole new set of Best Practices that will be standard in a few months.

Rails is conceptually easy, there is just a lot of it. Others will link you to better tutorials; I will just list things you might want to look into once you've played with a tutorial or two.

I think it's imperative that you start off with http://rvm.beginrescueend.com/ - when you accidentally fuck your entire system it's great to just start fresh. It might complicate things for your Very First Try, but it will save your life in your Very First Installation of a Rails project.

Once you're up on that, try to figure out how gems work - it's the basis on which a lot of what we do revolves on. Fortunately the Ruby community has standardized on Github and so it's extremely easy to bone up on a lot of code out there.

At first Rails will feel like a lot of magic, but with some vigorous use of CTags, curiosity and adapting to the fast pace the community moves at you will pick it up fairly quickly.
posted by pmv at 7:52 AM on September 20, 2010


Also, w/r/t pmv's recommendation of RVM (which I also heartily recommend): you'll come across many tutorials that specifiy installing gems with sudo (if you're running Mac or other *Nix). With RVM you explicitly DON'T install gems with sudo. It'll screw everything up.

Also, you don't mention what OS you'll be developing on, but if it's a Mac, you'll probably find that installing certain gems (e.g. the MySQL gem) can be a major headache. The trick, though it certainly isn't apparent from web searches, is to have XCode installed so that the necessary libraries are available for building gems with native code (like ruby-mysql, nokogiri).

Finally, once you start getting your head around the apparent magic of Rails, I recommend the book Ruby for Rails, which goes into some depth about the uniquely Ruby features that make Rails possible (runtime class modification, method_missing, etc.). Even though the book is several years old, I'm sure 99% of the concepts still apply. The Rails Way by Obie Fernandez is another great Rails book, and the Rails 3 edition of it should be out within the next couple of months.
posted by yalestar at 8:18 AM on September 20, 2010


To further clarify, the new environment will be all Mac. Not sure the version they're current running though; I'll find that out.

I have XCode installed right now, so thanks for the pointer regarding the mySQL gem, yalestar.
posted by (bb|[^b]{2}) at 9:02 AM on September 20, 2010


Another tip on Ruby installation on Mac: if you have the latest MacPorts (1.9.1), you can install Ruby 1.9.2 by default (note you will probably need to back up your default binaries in /usr/bin and link to the newly installed ones in /opt/local/bin or whereever MacPorts is installed on your system), and therefore run Rails 3 without a hitch. This is what I do, because I tried installing RVM in the past and had trouble, and I'm too lazy to get it working. Not dissing it, 'cause I can see how it would be super awesomely useful, but I just don't have the need at the time since 1.9.2 installed via MacPorts works great for me. Just adding this since it may get you up and running faster...but don't dismiss what pmv says either.

The latest Ruby version on Mac OS X Snow Leopard (10.6) I think is 1.8.7, they are always behind (understandably).
posted by dubitable at 9:35 AM on September 20, 2010


For Ruby, not Rails: The EdgeCase Ruby Koans.

It consists of a file with unit tests, 29 categories of them. You simply run the test suite, see where it failed, and fix the code so it passes the test. Just, ideally, like you would for real:

[ ruby_koans ] $ ruby path_to_enlightenment.rb
(in /Users/person/dev/ruby_koans)
cd koans

Thinking AboutAsserts
test_assert_truth has damaged your karma.

You have not yet reached enlightenment ...
<false> is not true.

Please meditate on the following code:
./about_asserts.rb:10:in `test_assert_truth'
path_to_enlightenment.rb:27

mountains are merely mountains


posted by RikiTikiTavi at 1:31 PM on September 20, 2010 [2 favorites]


« Older How much will it cost to reuph...   |  How does one go about selling ... Newer »
This thread is closed to new comments.