If you have done some web development before (maybe python, maybe php, maybe ASP 1.0) go read the getting started guides and get rolling. It's a big framework and there is a lot there but if this not your first rodeo it's not going to take long to get it. You know what MVC is and rails is just anther (good) web framework with some nice code generation to start you off fast. Oh and that ORM can be handy too!
If you are new to Ruby or web dev I would suggest you first start with Sinatra (http://www.sinatrarb.com
That will give you an idea of what basic basic web dev looks like in ruby without the overhead of a huge framework to take in.
After you have a simple hello world running with Sinatra then see about adding an external gem. (Maybe the 'shotgun' gem mentioned on the Sinatra site) then learn about bundler http://gembundler.com and get Sinatra running with that setup. Look at the template languages (erb, haml) and play with those. When you find yourself playing with middleware then maybe look at rails and see what it has to offer. At this point you will already have a felling for how everything fits together with a rack based web app (Sinatra and Rails both use Rack) at a little lower level and I think you will have a better experience with rails and be more productive because of it.
EDIT: Submissions that have links to articles with questions marks in the title are annoying. Thought it was an ask HN at first.
In all honesty, I would forget about Rails unless you have a really, _really_ compelling reason to pursue it. Rails is such a big framework, you could easily spend as much time learning it (Rails) as you would learning Ruby itself. I would recommend starting with Sinatra and Padrino for Ruby based web frameworks, you'll likely find you never need anything more unless you get a job at a Rails shop.
In terms of Ruby itself, having picked it up myself only fairly recently I would recommend the following:
- unless you plan on maintaining someone elses code, jump straight into Ruby 1.9.
- hang out in the IRC channels, #ruby-lang and #sinatra on Freenode. The community is awesome and really helpful.
- the Sinatra video from Peepcode is really good
- for books, I would recommend "Cloning Internet Applications with Ruby" (ISBN 978-1849511063), "Beginning Ruby from Novice to Professional, 2nd Ed" (ISBN 978-1430223634) and of course the current version of the Pickaxe book (google it :)
- check out thechangelog.com regularly if you don't already
That's about it, good luck with it - I've found it fun so far and am currently developing my first web app on top of Sinatra which i hope to launch in a month or so!
Personally, if you want to learn something - jump in and learn it - do what interests you.
I started with Rails first (someone sent me a PDF of an early Rails manual - I started skimming it about 8am, finished the entire book of 300+ pages by supper - not sure I even ate anything in-between).
After playing with Rails for a few months I started to look at Ruby itself - it's an awesome language.
I can't thank you enough for mentioning Cloning Internet Applications with Ruby. It looks like a great Sinatra-based alternative to Michael Hartl's Rails tutorial. I need to scan Packt titles more often.
The Sinatra videos from screencasts.org are also really good and they're free. I'd been considering subscribing to Peepcode, but with screencasts.org and railscasts.com I'm now not convinced I need to.
Depending on how much or how little you know, this may be useful: Roadmap for Learning Rails[1].
In some sense, it's an ideal and you could probably learn some of these things at the same time. That said, if you know nothing about HTML or SQL or <insert many other things here>, you're going to find Rails overwhelming and simply not get a lot of what you're doing. (Maybe that's fine too. Dive in, get lost, figure out parts of it. Lather, rinse, repeat. Some people probably learn this way, but some people no doubt like things a bit more orderly.)
Definitely check out the Rails Tutorial. There is a book (paper or bits), and really nice screencasts. The thing I like about Michael Hartl is he is really down to earth, fun, and acknowledges in the video if he doesn't know something. I bought the PDF and screencasts and am working through it right now--I'm on chapter 5.
I found Rails for Zombies big on theme but very small on substance. By the end, I asked myself... what did I actually create? Nothing! I typed in a few things into a Web browser that did some monkey-magic on the backend to tell me if what was in the textbox was "correct". They kept saying we were going to build "Twitter for Zombies", but I never did. What a let down.
I would emphatically recommend that if possible you attempt to give yourself a good grounding in ruby metaprogramming before learning rails.
It will help you greatly in understanding how and why rails works the way it does.
The rails internals contain lots and lots of "magic" stuff, which if rails is your first introduction to ruby, you will find you have trouble differentiating what is ruby and what is rails's magic.
Are there any definitive resources to understand how Rails uses metaprogramming? I once failed in an attempt to understand the scope of metaprogramming in Ruby by searching for information in the pickaxe book (but gave up way too soon to be fair).
I tried to learn Ruby and Rails at the same time, but found it stressful to learn Ruby's elaborate syntactic sugar and Rails' enormous API at the same time. For me it certainly helped prototyping my application in Sinatra first and then dive into Rails once I understood more quirks of the language and it's web stack.
That's exactly where I started when trying to learn rails the first time and it was an utter failure that consumed an entire vacation and didn't really get me very far.
About a year after that I tried O'Reilly's HeadFirst rails book and got much much more out of my effort.
+1 on all the various comments recommending learning Ruby first and then Rails.
The Ruby standard library is pretty big, and the language has a large number of syntax options, which means that there are often 30 different ways to do something, and you'll often see over half of those in the real world. Those various options can be undeniably handy at times, but even after working in Ruby for several years it's not uncommon to come across code that uses something you haven't seen before.
Rails is great, but it's quite large and also quite clever, and clever can be very difficult to understand unless you have a solid grasp of the language.
Starting with something simpler like Sinatra would be a great idea, but I'd still recommend going through a Ruby book first.
The most difficult thing for me learning Ruby on Rails was separating what cleverness was coming from Ruby and what cleverness was coming from Rails, learning as much as you can about ruby first would be a huge help.
I would recommend learning Ruby (if you don't know it already; if you come from other imp. languages, don't fall for the trap that 'it kind of looks the same' ; sure it does, but unless you learn a lot of the great syntax and language features, you won't be having too much fun imho) and then just starting a medium sized project for yourself to find out how rails works. Whatever you want to do, you can find it on Google; study the solution, try it out, tweak it to what you want to achieve. During such a project, you'll learn fast about practical Rails things. You might end up loving or hating it ;)
Edit: tutorials didn't help me much; they all blabla about the crud stuff which is boring as you'll probably never use it. That's why I suggest not going that route.
3. I ran "rails new" and started trying to code out what I was imagining. Anything that Simply Rails 2 didn't teach, I googled (e.g. FB/Twitter authentication with Omniauth, following/follower "friendship" models, Twilio integration, etc.).
If you're not coming into this with any scripting experience, I would absolutely recommend checking out http://tryruby.org/ first.
I am a "business guy" who was proficient in PHP. Here's what I did:
- Bought a beginning Ruby book and gave it a quick perusal to get a handle on the fundamentals
- Went through Michael Hartl's amazing Rails Tutorial (I skipped over some of the detailed sections on testing with the intention of returning at a later point.)
- Finally, and most importantly, I converted an old PHP app into Rails. This helped me to see how what I wrote previously would fit into the Rails way of doing things.
Mainly for complete beginners, but, learning Ruby and/or Rails is great and all, however, a lot of beginners tend to not understand the principles behind web development such as SQL or javascript or security or HTML.
What really astounds me is that people take ActiveRecord at face value and do stupid things such as Foo.all.sort_by(&:blah) or Foo.all.select {|x| x.stuff == "term"} and don't understand why it's such a bad idea.
After doing Rails for about 4 years, and Django for about 2 months (but I've been doing python for 10 years now) ... save yourself some pain and learn Django instead, if you can at all help it.
Ruby's documentation culture is hair-tearingly frustrating. Half a paragraph, 3 examples covering the barest functionality of your module, and pages of badly-interfaced mechanically-extracted documentation made me want to punch the monitor several times a day.
Oh, but it's got a pretty web-2.0tard design-minded web site, and of course gitardhub, which is especially a joy if it goes down during a deploy.
[+] [-] andymoe|15 years ago|reply
If you are new to Ruby or web dev I would suggest you first start with Sinatra (http://www.sinatrarb.com
That will give you an idea of what basic basic web dev looks like in ruby without the overhead of a huge framework to take in.
After you have a simple hello world running with Sinatra then see about adding an external gem. (Maybe the 'shotgun' gem mentioned on the Sinatra site) then learn about bundler http://gembundler.com and get Sinatra running with that setup. Look at the template languages (erb, haml) and play with those. When you find yourself playing with middleware then maybe look at rails and see what it has to offer. At this point you will already have a felling for how everything fits together with a rack based web app (Sinatra and Rails both use Rack) at a little lower level and I think you will have a better experience with rails and be more productive because of it.
EDIT: Submissions that have links to articles with questions marks in the title are annoying. Thought it was an ask HN at first.
[+] [-] sradnidge|15 years ago|reply
Agreed, so did I!
[+] [-] sradnidge|15 years ago|reply
In terms of Ruby itself, having picked it up myself only fairly recently I would recommend the following:
- unless you plan on maintaining someone elses code, jump straight into Ruby 1.9.
- hang out in the IRC channels, #ruby-lang and #sinatra on Freenode. The community is awesome and really helpful.
- the Sinatra video from Peepcode is really good
- for books, I would recommend "Cloning Internet Applications with Ruby" (ISBN 978-1849511063), "Beginning Ruby from Novice to Professional, 2nd Ed" (ISBN 978-1430223634) and of course the current version of the Pickaxe book (google it :)
- check out thechangelog.com regularly if you don't already
That's about it, good luck with it - I've found it fun so far and am currently developing my first web app on top of Sinatra which i hope to launch in a month or so!
[+] [-] mtkd|15 years ago|reply
I started with Rails first (someone sent me a PDF of an early Rails manual - I started skimming it about 8am, finished the entire book of 300+ pages by supper - not sure I even ate anything in-between).
After playing with Rails for a few months I started to look at Ruby itself - it's an awesome language.
[+] [-] telemachos|15 years ago|reply
[+] [-] kaerast|15 years ago|reply
[+] [-] ahmicro|15 years ago|reply
[+] [-] nhebb|15 years ago|reply
Web resources:
- http://guides.rubyonrails.org
- http://peepcode.com
- http://railscasts.com
- https://github.com/edgecase/ruby_koans
Books:
- http://www.pragprog.com/titles/rails4/agile-web-development-... : Agile Web Development with Rails
- http://pragprog.com/titles/ruby3/programming-ruby-1-9 : Programming Ruby 1.9 (Pickaxe book)
- http://www.amazon.com/Rails-Way-Addison-Wesley-Professional-... : The Rails 3 Way
[+] [-] tvon|15 years ago|reply
On a related note, I was recently directed to http://asciicasts.com/ for railscasts in text format... quite nice.
[+] [-] telemachos|15 years ago|reply
In some sense, it's an ideal and you could probably learn some of these things at the same time. That said, if you know nothing about HTML or SQL or <insert many other things here>, you're going to find Rails overwhelming and simply not get a lot of what you're doing. (Maybe that's fine too. Dive in, get lost, figure out parts of it. Lather, rinse, repeat. Some people probably learn this way, but some people no doubt like things a bit more orderly.)
[1] http://techiferous.com/2010/07/roadmap-for-learning-rails/
[+] [-] dtegart|15 years ago|reply
Also Railscasts is a fantastic resource.
[+] [-] craftsman|15 years ago|reply
Then, you and a friend should go build something!
[+] [-] jot|15 years ago|reply
http://tryruby.org/
http://railsforzombies.org/
[+] [-] shaggyfrog|15 years ago|reply
[+] [-] DavidChouinard|15 years ago|reply
[+] [-] glenjamin|15 years ago|reply
It will help you greatly in understanding how and why rails works the way it does.
The rails internals contain lots and lots of "magic" stuff, which if rails is your first introduction to ruby, you will find you have trouble differentiating what is ruby and what is rails's magic.
[+] [-] stephth|15 years ago|reply
[+] [-] oliland|15 years ago|reply
[+] [-] mtkd|15 years ago|reply
Those guides are an exercise in best practice framework documentation.
[+] [-] xiaoma|15 years ago|reply
About a year after that I tried O'Reilly's HeadFirst rails book and got much much more out of my effort.
[+] [-] craftsman|15 years ago|reply
[+] [-] unknown|15 years ago|reply
[deleted]
[+] [-] bdickason|15 years ago|reply
[+] [-] snkashis|15 years ago|reply
[deleted]
[+] [-] kinofcain|15 years ago|reply
The Ruby standard library is pretty big, and the language has a large number of syntax options, which means that there are often 30 different ways to do something, and you'll often see over half of those in the real world. Those various options can be undeniably handy at times, but even after working in Ruby for several years it's not uncommon to come across code that uses something you haven't seen before.
Rails is great, but it's quite large and also quite clever, and clever can be very difficult to understand unless you have a solid grasp of the language.
Starting with something simpler like Sinatra would be a great idea, but I'd still recommend going through a Ruby book first.
The most difficult thing for me learning Ruby on Rails was separating what cleverness was coming from Ruby and what cleverness was coming from Rails, learning as much as you can about ruby first would be a huge help.
[+] [-] tluyben2|15 years ago|reply
Edit: tutorials didn't help me much; they all blabla about the crud stuff which is boring as you'll probably never use it. That's why I suggest not going that route.
[+] [-] anulman|15 years ago|reply
Note: I had a bit* of Python scripting experience, and knew my way around HTML and CSS.*
1. A friend recommended SitePoint's Simply Rails 2. I went through that cover-to-cover, googling for where Rails 3 commands differ from Rails 2.
2. I used an old tutorial for rolling my own user model from scratch (still in the Sitepoint piece): http://www.aidanf.net/rails_user_authentication_tutorial
3. I ran "rails new" and started trying to code out what I was imagining. Anything that Simply Rails 2 didn't teach, I googled (e.g. FB/Twitter authentication with Omniauth, following/follower "friendship" models, Twilio integration, etc.).
If you're not coming into this with any scripting experience, I would absolutely recommend checking out http://tryruby.org/ first.
[+] [-] sayemm|15 years ago|reply
The Railscasts are a great resource as well - http://railscasts.com/episodes/archive
And a good starting resource for Ruby is the pickaxe book - http://www.amazon.com/Programming-Ruby-1-9-Pragmatic-Program...
[+] [-] minouye|15 years ago|reply
- Bought a beginning Ruby book and gave it a quick perusal to get a handle on the fundamentals
- Went through Michael Hartl's amazing Rails Tutorial (I skipped over some of the detailed sections on testing with the intention of returning at a later point.)
- Finally, and most importantly, I converted an old PHP app into Rails. This helped me to see how what I wrote previously would fit into the Rails way of doing things.
[+] [-] omarqureshi|15 years ago|reply
What really astounds me is that people take ActiveRecord at face value and do stupid things such as Foo.all.sort_by(&:blah) or Foo.all.select {|x| x.stuff == "term"} and don't understand why it's such a bad idea.
[+] [-] Luyt|15 years ago|reply
http://en.wikipedia.org/wiki/Why_the_lucky_stiff
One of the developers in the video suggested to learn some Ruby first before diving into Rails.
[+] [-] kujawa|15 years ago|reply
Ruby's documentation culture is hair-tearingly frustrating. Half a paragraph, 3 examples covering the barest functionality of your module, and pages of badly-interfaced mechanically-extracted documentation made me want to punch the monitor several times a day. Oh, but it's got a pretty web-2.0tard design-minded web site, and of course gitardhub, which is especially a joy if it goes down during a deploy.
Think I'm exaggerating?
http://code.macournoyer.com/thin/doc/files/README.html
[+] [-] kongqiu|15 years ago|reply
[+] [-] nraynaud|15 years ago|reply