How Can a .NET Developer Get Started on Ruby or Rails?

Common question for .NET developers deciding to venture into Ruby are: Where do I start? What should I learn first: Ruby or Rails? What do I need installed? What are the best resources to get started? Where do I find more in-depth information?

In this post I’ll answer each one of those questions. However, keep in mind that this is solely based on my own experiences; what worked well for me may not work well for you (well, that should be said for every single blog post out there, right?).

Do I Learn Ruby or Rails First?

After Putting Ruby, Rails, C#, and ASP.NET in context, the first question that may come to mind is: should I learn Ruby (the language) first, or should I learn Rails (the framework) first?

I think most people would think “well, you must learn the language before you learn the framework…”. Even though several people indeed prefer to learn Ruby first, Rails does make it so that you can get quite a bit done without knowing a whole lot of Ruby. That was the route I took.

Ruby is not that different from the most popular languages out there, so if we’ve had experience writing software before, we can kind of guess what the following code does:

if some_condition
    variable = some_value
end

We wouldn’t have problem guessing even if the code was written more in the “Ruby Way”:

variable = some_value if some_condition

One of the advantages of starting with Rails is the immediate reward of seeing a working application. If you start learning Ruby first instead, then you’re rewarded with the comprehension of language syntax and constructs… I don’t know about you, but the latter sounds kind of boring to me.

With that said, one of the disadvantages of that approach is that Rails performs a lot of “black magic” in order to get stuff done. That does bother people who want to be in control of everything, but it doesn’t bother me; I’d rather see things getting done, even though I don’t fully understand it. Afterwhich, I learn the spells as I get more experienced with the way of doing things in Rails.

What do I need installed?

If you go down the same route of learning Rails first, and I’m assuming you’ll be running a Windows machine, the best way to get the things you need installed is by visiting RailsInstaller.org. Download and install the RailsInstaller, which includes the things you’ll absolutely need (such as Ruby, Rails, and Bundler), as well as a couple more things you’ll likely end up using (such as Git and Sqlite).

While you’re at the RailsInstaller.org site, I recommend you take the time to watch the video in their “step 2″ instruction; it walks you through the installation process, as well as creating your first Rails application (and deploying it to Engine Yard!) in order to make sure everything works well.

It’s a Command-Line World!

In the Ruby and Rails camp, pretty much everybody spends a lot of time in the command-line, creating projects, generating controllers and models, running tests, etc. I’d recommend you use PowerShell, instead of the old DOS Command Prompt (even when doing only .NET I had gotten used to using PowerShell for several things… it is a lot faster than any IDE, and I’m yet to see it freeze or crash on me). I also recommend you try out Console2 so you can get a nice tabbed-interface.

We Edit Text Files!

When we’re building .NET applications, we’ve very likely editing text files. Even when we’re using the so-called “designers” (dragging and dropping our way to conquer the world), at the end of the day we’re creating text files (xml, xaml, html, you name it).

In the Rails camp, nobody really cares about fancy designer tools; things get gone by editing text files directly. When I started with Rails, I’ve made a point to myself to use Notepad (actually, Notepad2) for a couple of weeks, because I wanted to see what exactly I’d miss from my “Visual Studio overdosed with add-ons” (I’m one of those few freaks who use both CodeRush and Resharper at the same time).

After a couple of weeks, I figured I missed things such as refactoring tools, auto-completion in certain scenarios, easy navigation through files and classes, so I decided to give [RubyMine] a try, and that’s what I’ve been using since then.

I have also started to learn Vim, as it fits well my keyboard-centric way. However, it has a steep learning curve, so I’m getting into it in small doses.

“But I want my Visual Studio awesomeness!”, I can almost hear you cry. If you use Resharper in Visual Studio, you’ll probably feel right at home with RubyMine. If you do indeed feel like what you want is Visual Studio, you may want to try Ruby in Steel; I haven’t personally tried it, so I can’t share any experiences with it. Honestly, since software development is mostly all about editing text, I don’t want to fire up such a heavy and bloated tool as Visual Studio.

Resources for Learning

Tutorials, articles, blogs, books, podcasts, webcasts… there’s a lot of material available for you to learn Rails. Here are some of the ones that have been very useful for me:

  • Rails for Zombies: I take humorous and wacky ways to learn technical things over boring literature any day. Rails for Zombies is a cool way to learn some of the basics parts of a Rails app. On each level, it has a short video that explains the part being covered, and then it takes you to a hands-on lab, where you can try things yourself, right within your web browser, without a need to install anything. There’s also a downloadable PDF file containing the slides presented in the course; I’ve shoved that file into Evernote, as I keep going back to it when I need to remember some syntax or whatever…

  • Rails Tutorial: Here you’ll find an entire book that teaches you Rails, as well as a screencast of the content (14 hours of great material!). I got the bundle (e-book plus screencasts), and went through the whole thing, following along every step of the way. I’ve learned quite a bit from this one…

  • Rails 3 In Action: great book!

  • Ruby Rogues, The Ruby Show, Ruby 5: are some of my favorite podcasts.

  • Virtual Brown Bag: Free weekly where people get together to share a bunch of tips. Over the last several months, most of the things shared have something to do with Rails (yours truly happens to do quite a bit of the sharing over there, too!).

Hopefully, you’ve also been following our Switching to Ruby from .NET series, which already contains quite a bit of a material, and you can expect a lot more to come.

Getting Started

Again, there’s a lot of material out there, and I’ve mentioned some of the ones that have helped me. I’d recommend that once you’re done watching the afore mentioned video on RailsInstaller, the next stop should probably be the Ruby on Rails Guides, which covers all the core things you need to know about Rails. Those should keep you busy for a little while.

Getting More In-Depth

I have been writing several posts for my personal blog over the last couple of months, documenting my experiences learning Rails. I’m also keeping a shared note with resources that have been (or still are) helpful to me. Make sure to check those out!

Nothing beats getting your hands dirty!

I read lots of books, articles, blogs, watch lots of videos, talk to people way smarter than me… but none of that beats getting my hands dirty and actually building applications with Rails. Just think up of a simple application, and commit to writing it in Rails. That’s what I did, and it has been working out great. Whenever I get stuck, I post questions on StackOverflow, the #RubyOnRails IRC room on freenode.net, or bug my Rails buddies. :)

Free book: Jump Start HTML5 Basics

Grab a free copy of one our latest ebooks! Packed with hints and tips on HTML5's most powerful new features.

  • ghendry
  • Jose Gonzalez

    Reading? Code or bust I say!

    1) http://tryruby.org (they just updated the site OMG! I’ll probably go thru the exercises again)
    2) http://rubykoans.com/

    I’m still not done with my Ruby Koans (I know I know BAD dev). But thanks Claudio for reminding me about Rails for Zombies. Programming + gaming my two greatest vices.

    • http://www.lassala.net Claudio Lassala

      Oh, yes, TryRuby.org is great (and now it’s even better), and Ruby Koans rocks!

  • Joey

    This article lost all credibility when it didn’t include railscast.com in the resources. Might I also add that developers on a windows machine look into installing Ubuntu (not running in virtual box) and coding from there because ruby 1.9.2 is orders of magnitude slower when compared to a *nix based machine.

    • http://www.lassala.net Claudio Lassala

      Hi Joey,

      Thank you for your comments. I tried to keep the post short and list only the resources I’ve used immediately when getting started. RailsCasts is an awesome site, which I do have listed in my “shared note” (linked to in this post, by the way), but I wouldn’t get started with it.

      I’ve also looked into running Ubuntu when I started, but not knowing any Linux at all, I got stuck really bad, so I decided to just stick with familiar (albeit slow) Windows environment, because that way I could concentrate on learning just Ruby on Rails, and not an entire O.S. Once I got more comfortable with RoR, then I got me a Mac.

  • Stephen

    I for one would have never even glanced at this article until I heard Claudio’s speech on trying Ruby on Rails this past Houston TechFest. To me that discourse alone made Houston TechFest worth attending and is the only reason why I’ll try Ruby on Rails in the near future!

    Joey, if someone were to copy/paste or type railscast.com as you have it they would miss out on the real site: railscasts.com. I wasn’t even sure it was a correct site until I took the time to take your misspelling and google it.

    “The beginning of wisdom is to call things by their proper name.”
    ― Confucius

    Then when I look at the site itself nothing is presented in a logical manner where a new person could start learning Ruby (from a beginning) like the purpose of this article. I would have to search to find a valid video but yet that wouldn’t give me necessarily a starter one if I hadn’t even tried it yet. Nevertheless, thanks for providing the site and the tips about Ubuntu.

    And very much thanks for Claudio’s article and efforts thus far!

    • http://www.lassala.net Claudio Lassala

      Hi Stephen,

      I’m very glad to know you enjoyed my talk at TechFest. I hope you enjoy RoR as much as I do.

      You got the correct interpretation on why I didn’t include RailsCasts in this post (but I do include it in my “shared note” with all the resources I find useful): it is a source of AWESOME material, but not exactly great for somebody who’s just getting started.

  • http://kiranatama.com Rooby G

    I agree with other posters that the article pertains to Web development only. Even then I think it comes down to personal taste. There’s no need to deride a developer for using .net or ruby or whatever enables him/her to do the job. If you can really think outside the box, you’d choose platform/, framework based on a situation — who the project is for, time and money, etc. There was too much of that derision displayed by the respondents in the article (hope it made them feel superior).