views:

1713

answers:

15

I've been wanting to learn Ruby for a long time since there seems to be alot of buzz about it the last couple years. From what I've seen/read there have been a few Ruby'esk things that have been brought over the .NET too.

Should I start with learning the Ruby language and just focus on writing simple command-line apps first? Or, should I start with Ruby On Rails to do Web Development first since that is what I really want to learn Ruby for?

Also, would you recommend any books on the topic?

+3  A: 

Start with Rails.

Agile Web Development with Rails is now in 3rd edition in beta form, so you can buy beta PDF right now for $24 and be coding late into the night tonight :)

ryw
+19  A: 

Ruby is extremely fast to pick up so I would suggest just diving into Rails if that's your endgame, especially if you already have some idea of general programming and web application concepts. Rails is just fine for larger apps if you design and implement your app correctly.

And yes, I learned using the Agile Development With Rails book back in the Rails 1.2 days, it's a great book!

edit: I learned Ruby by doing a Rails project, so I have personal experience skipping the "lets learn the language first" methodology. It's fine.

MattC
Similar story. I learned Python with django and Google App Engine. Learned JavaScript with jQuery (yes, i've learned "JavaScript the good parts" to understand thoroughly about callback functions).
nil
+4  A: 

If you want to learn Ruby in order to develop web apps, you should learn the Ruby on Rails framework first. But - Ruby is a beautiful and powerful thing on its own, and you should make sure to learn it as you learn RoR. You'll need its power, and RoR isn't the only web framework for Ruby, so a deep knowledge of Ruby will help you no matter what framework you use.

Although it's a bit dated, Ruby for Rails is a good resource for the Rails developer who wants to improve his or her Ruby skills.

Clinton R. Nixon
+8  A: 

In my experience, the best way to learn a language is to do a real project with it. With that being said, writing some command line apps with Ruby would be simpler and easier than diving right into Rails.

So if you have some command line programs you've really been itching to write that you'd really find useful and want to experiment with and extend, then I'd start with that. On the other hand, if it's a choice between some simple teach-me-the-language command line programs or a real website that's a serious project, then I'd start with Rails.

Eli Courtwright
+1  A: 

If you have a project on which to use ruby, I'd recommend starting with that. Ruby on Rails adds a bunch of things to ruby like

  8.minutes.ago
  cattr_accessor

and it's a good discipline good know where ruby ends and rails begins

Purfideas
Alternatively, simply do `require 'activesupport'` at the top of your 'regular' ruby scripts and most of those little niceties will be available. `5.days.ago`, etc.
thenduks
+1  A: 

This is exactly what I did. I started learning ruby and ROR at the same time and it was no problem. I might even suggest that it is better because the fact the you are working on a real project in rails really pushes you to learn ruby better.

Also, Agile Web Development with Rails is a really awesome book, but you'll definitely want to go for the 3rd edition, with the way that ROR is moving and changing.

Paul Wicks
A: 

With all due respect, you can reformat your question as "Should I learn C# first, or go directly to learn the .NET framework?". Or the same regarding Java/Hibernate, etc.

The answer to the above question is exactly the same as yours. You can of course go directly trying to understand a framework without mastering the language first. And with a language as easy, simple and logical as Ruby, probably much more so than with Java/C#/etc.

But then you'll be losing a very big part of what the language is capable of. Furthermore, some usages or constructs used within the framework (or in sample applications of it) will baffle you for you've not mastered the language first.

If you'd like an über-simple tutorial on Ruby, try Why's Poignant's Guide to Ruby. You'll learn more about Ruby in 5 minutes than you'd thought possible!!! From the same author, you can then use website Try Ruby! to test simple Ruby constructs on your browser, without having to download a Ruby compiler/interpreter.

Joe Pineda
The Poignant Guide link is broken since _why left the scene. Try http://mislav.uniqpath.com/poignant-guide/
thenduks
A: 

I have been programming in the Windows environment for more than a decade. About a year ago I started to learn Ruby on Rails.

It really felt like fresh air.

Even if you are not to going to work in real projects in Rails it will make you a better programmer.

hectorsq
+4  A: 

If you feel Rails to daunting, try one of the little Ruby web frameworks, like Ramaze.

Alfons
A: 

An interesting, albeit different, approach would be to start learning it with Ruby Shoes. It's a cross-plattform GUI toolkit packaged as complete Ruby distribution, and has a lot of interesting concepts - very Web-like. Easy to install and you learn Ruby without all the conventions RoR comes with.

AND: Documentation is availlable as PDF-Comic book :-)

BigD
The Shoes website is down since _why left the scene. Best to just start with the github repo for this one: http://github.com/shoes/shoes
thenduks
+1  A: 

Hi Chris,

Firsly Ruby/Rails support on Windows is woeful, if you only have a windows pc get vmware and install an ubuntu virtual machine, you will save yourself a world of unnecessary pain.

Then you might want just take a few days to learn Ruby first, there are plenty of good Ruby books and tutorials about.

Learning Rails can be tricky the majority of content out there is outdated, so make sure the version of Rails they use is 2.0 +. Peepcode.com video tutorials are extremely useful when starting out (but not free) and also check out RailsCasts as they are free.

The majority of Ruby/Rails projects have migrated to Git, so if you're unfamiliar with it you'll need to learn that too although if you have used SVN, that shouldn't be a problem. Checkout a few opensource Rails projects on GitHub and see how they do things if you get stuck.

Good Luck

MatthewFord
Actually the Ruby support is great on Windows. I haven't tried Rails yet, but I'm assuming things will be fine.
Chris Pietschmann
Ruby the language is supported, however when building an application you will generally use complied gems. Compiling natives gems on windows *is* a pain when you do not have the libs/binaries.
MatthewFord
A: 

If you find you don't have the time to dive into Ruby and/or Ruby on Rails enough for your liking, make sure you at least install Ruby and do your little admin tasks with it. Also, if you're a full-time .Net guy, do know that you can install MS IronRuby, which runs on the .Net platform, to write tests and to generally interact with .Net code.

webmat
+3  A: 

I started programming Ruby when I got fed up with the Ant build tool and found Rake. Rake seems like a good enough reason as any to learn Ruby. I've found all sorts of use for it, and more and more for Ruby in general too.

Theo
+1 Rake beats Ant hands down. XML-based build files - yuck!
Martin Owen
A: 

Beginning Buby: From Novice to Professional covers both the Ruby language and Rails.

Chris Pietschmann
A: 

It is always difficult to jump into a new subject unless you already have a clear use for it. I think about high school math class, learning about trigonometry. I didn't have a use for it at the time so had difficulty learning it and didn't retain it very long after. That was until I got into some OpenGL 3D proccessing, suddenly had a use for it and all those formulas suddenly made a whole hell of a lot of sense.

I would suggest diving right into to Ruby on Rails and learning Ruby as you go. You will retain a lot more of the ruby you learn this way, a lot better then working through some unrelated code examples.

Corban Brook