Hi HN,<p>I want to learn Ruby, and after I gain some experience or find it interesting, I want to do Rails. What's the best way to learn Ruby? Kindly suggest some good books or manuals.
The Well-Grounded Rubyist is an introduction that will take you through to a Ruby pro in no time. <a href="http://www.manning.com/black2/" rel="nofollow">http://www.manning.com/black2/</a><p>The official Rails guides are rough but a good resource. <a href="http://guides.rubyonrails.org/" rel="nofollow">http://guides.rubyonrails.org/</a><p>I wouldn't bother with the official Rails book.
You can't go wrong by picking up a copy of "The Ruby Programming Language" and "Agile Web Development with Rails". Between those two books you should be a master in no time.
The "best way" depends on your current skills, really. Ordered by increasing levels of programming skill, I'd say you should start with one of the following:<p>1. <i>Learn to Program</i> by Chris Pine<p>2. <i>Everyday Scripting with Ruby</i> by Brian Marick<p>3. <i>Programming Ruby: The Pragmatic Programmer's Guide</i> by David Thomas and Andrew Hunt<p>An excellent book to build your skills and internalize the common Ruby idioms is <i>The Ruby Way</i> by Hal Fulton.<p>As others have mentioned, <i>Agile Web Development with Rails</i> is The Book to use for learning Rails.<p>Of the above, the only book I don't have in one form or another is Chris Pine's (because it is, frankly, well below my skill level). There's an online tutorial by the same name, by the same guy, that can perhaps serve as a substitute -- but the book is much more complete, so if that's suitable to your skill level, I recommend getting the book.<p>Best o' luck! Ruby is a lot of fun.
If you're already comfortable with another object oriented language then picking up ruby is pretty straight forward, but I'll tell you what worked the best for me. I started out reading some of the above mentioned books, but when it came to sitting down and programming I still felt a bit lost. So I simple started with writing tests for very very simple things. Like test_print_hello_ten_times to teach me how to create an array and loop over it. I basically test drove how to work with the basic building blocks of the language and literally in an hour or two I felt very comfortable working in ruby.<p>Now I come from a background of doing TDD in java, so your milage my vary, but this was a very natural and easy approach to learning the language.
I was in your exact situation a couple of months ago. I recently built my first app, by the guidance from this post.<p><a href="http://news.ycombinator.com/item?id=679959" rel="nofollow">http://news.ycombinator.com/item?id=679959</a>