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.
Absolutely - i guess I was more just saying think about the reasons first. When I started I was set on Rails too, purely because that's the thing most people talk about and for newbies it's easy to just see it as "the done thing" if you know what I mean, and not look for alternatives. I got onto Sinatra when I quickly realised Rails was way too heavy for what i wanted to do.
But you're absolutely right, the best way to learn anything is to just jump in, and absolutely nothing wrong with Rails!
I have had the same path that you describe. Started learning Rails and quickly realizing that Sinatra handles most of my needs, and is faster to get started with. It is also helpful to separate my ruby learning with understanding the rails framework. Will check out those resources!
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 table of contents is impressive. Looks like a good pick even for moderately experienced developers, interested in taking Sinatra to the next level. Has anyone built working apps using this guide?
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 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.
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'm not really sure, there's an O'reilly book "Metaprogramming Ruby" (http://oreilly.com/catalog/9781934356470) which i flicked through once. It seemed to mostly dicuss how ActiveRecord works. At the point I had access to a copy I was already pretty familiar with the concepts, so can't really say how good the book actually is.
I mostly picked things up by reading code and some blog posts whenever I came across an odd idiom.
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.
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.
here are the three that within in a month you should be able to write some sweet apps quickly.
1. Head First Rails
I first poohed this book but I had read 7-8 other books adn still was confused so I thought what the hell.
I did each project several times and started making changes. Totally awesome especially the ajax integration parts. This is when I could actually make my own simple apps in less than a week.
2. I loved Agile Programming book - totally awesome. Not enough apps though. Great explanations. Gentle exposure to Ruby.
3. beginning novice to professional for ruby. I love this book. It is just plain fun. Good examples. I totally had fun with this. Peter is totally totally awesome - I wish he would write every tech book!!
Now you have the grounding, start making and asking questions.
What killed me was the UX/UI stuff. Then a friend suggested CSS Mastery book and using blueprint this got me clued in. Now I was not paralyzed. It was so awesome to see an app created in literally minutes.
I loved RoR - I miss it terribly. I disliked the community. Fanboyish. It was like being in all male high school with everyone thumping their chests and no help.
I still miss it very much. Whenever I code I first think in RoR then do it in php. My background was coldfusion, c#asp.net, java, etc. I need something dumb simple and php does the trick. And the people are nice and there are tons and tons of example to do anything. Also I needed something that is simple to deploy and maintain. Yeah yeah -RoR is easy to deploy - my first deployment took me several hours. Whereas php was minutes. In terms of sys admin and performance and optimization, I rather deal with php. As DBA, I do not really want an ORM. BTW when you feel good with RoR - check out Enterprise Rails - wow - good stuff on performance and optimization.
You know, I used to develop web apps using both Django and Rails. What made me stop using Django was this sheer fanboism by Django community. I couldn't stand it. Sure, there was a time when Rails devs were known for their fanboism. But not anymore. I find the Rails community acts a lot matured nowadays. On the other hand the Django community is going downhill. For every web framework recommendation question on StackOverflow, its "Django! Django!". They don't even bother to see the requirements. It gets even uglier on Reddit. A Django fanboy even bothered to start this site: http://ihaterubyonrails.com
Interesting, having built Django apps for a few years now I haven't noticed this ravenous Django fanboyism myself, but I'm about to start a full time job working with Rails so maybe I'll catch some flak as I mix my community participation a bit more. Granted, I have my own list of Django pet-peeves anyway, so I don't tend to let any "Django rocks, fuck Rails" comments go uncorrected.
May i know what did i post that is irrelevant to this discussion to get downvoted? You down voted me because i asked for evidence? As a mater of fact django devs were receptive to Criticism http://news.ycombinator.com/item?id=1777403
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.