TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Learning Ruby and Rails, where would you start?

100 点作者 ahmicro大约 14 年前

22 条评论

andymoe大约 14 年前
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!<p>If you are new to Ruby or web dev I would suggest you first start with Sinatra (<a href="http://www.sinatrarb.com" rel="nofollow">http://www.sinatrarb.com</a><p>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.<p>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 <a href="http://gembundler.com" rel="nofollow">http://gembundler.com</a> 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.<p>EDIT: Submissions that have links to articles with questions marks in the title are annoying. Thought it was an ask HN at first.
评论 #2400029 未加载
sradnidge大约 14 年前
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.<p>In terms of Ruby itself, having picked it up myself only fairly recently I would recommend the following:<p>- unless you plan on maintaining someone elses code, jump straight into Ruby 1.9.<p>- hang out in the IRC channels, #ruby-lang and #sinatra on Freenode. The community is awesome and really helpful.<p>- the Sinatra video from Peepcode is really good<p>- 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 :)<p>- check out thechangelog.com regularly if you don't already<p>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!
评论 #2399772 未加载
评论 #2400100 未加载
评论 #2399832 未加载
评论 #2401786 未加载
nhebb大约 14 年前
A list of resources from the video:<p>Web resources:<p>- <a href="http://guides.rubyonrails.org" rel="nofollow">http://guides.rubyonrails.org</a><p>- <a href="http://peepcode.com" rel="nofollow">http://peepcode.com</a><p>- <a href="http://railscasts.com" rel="nofollow">http://railscasts.com</a><p>- <a href="https://github.com/edgecase/ruby_koans" rel="nofollow">https://github.com/edgecase/ruby_koans</a><p>Books:<p>- <a href="http://www.pragprog.com/titles/rails4/agile-web-development-with-rails" rel="nofollow">http://www.pragprog.com/titles/rails4/agile-web-development-...</a> : <i>Agile Web Development with Rails</i><p>- <a href="http://pragprog.com/titles/ruby3/programming-ruby-1-9" rel="nofollow">http://pragprog.com/titles/ruby3/programming-ruby-1-9</a> : <i>Programming Ruby 1.9</i> (Pickaxe book)<p>- <a href="http://www.amazon.com/Rails-Way-Addison-Wesley-Professional-Ruby/dp/0321601661" rel="nofollow">http://www.amazon.com/Rails-Way-Addison-Wesley-Professional-...</a> : <i>The Rails 3 Way</i>
评论 #2401026 未加载
telemachos大约 14 年前
Depending on how much or how little you know, this may be useful: Roadmap for Learning Rails[1].<p>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 <i>nothing</i> about HTML or SQL or &#60;insert many other things here&#62;, 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.)<p>[1] <a href="http://techiferous.com/2010/07/roadmap-for-learning-rails/" rel="nofollow">http://techiferous.com/2010/07/roadmap-for-learning-rails/</a>
dtegart大约 14 年前
Michael Hartl's Rails Tutorial is a good start <a href="http://ruby.railstutorial.org/" rel="nofollow">http://ruby.railstutorial.org/</a><p>Also Railscasts is a fantastic resource.
评论 #2399915 未加载
jot大约 14 年前
I would recommend the following online tutorials. My wife, who'd done a little Java before, became a Ruby fan in an evening thanks to these:<p><a href="http://tryruby.org/" rel="nofollow">http://tryruby.org/</a><p><a href="http://railsforzombies.org/" rel="nofollow">http://railsforzombies.org/</a>
评论 #2401636 未加载
评论 #2399836 未加载
glenjamin大约 14 年前
I would emphatically recommend that if possible you attempt to give yourself a good grounding in ruby metaprogramming <i>before</i> learning rails.<p>It will help you greatly in understanding how and why rails works the way it does.<p>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.
评论 #2400863 未加载
oliland大约 14 年前
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.
mtkd大约 14 年前
Everything you need is here: <a href="http://guides.rubyonrails.org/getting_started.html" rel="nofollow">http://guides.rubyonrails.org/getting_started.html</a><p>Those guides are an exercise in best practice framework documentation.
评论 #2400112 未加载
craftsman大约 14 年前
I would also add the Pragmatic Programmer's _Agile Web Development with Rails, 4e_.
评论 #2400134 未加载
评论 #2399930 未加载
评论 #2400135 未加载
kinofcain大约 14 年前
+1 on all the various comments recommending learning Ruby first and then Rails.<p>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.<p>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.<p>Starting with something simpler like Sinatra would be a great idea, but I'd still recommend going through a Ruby book first.<p>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大约 14 年前
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 ;)<p>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 <i>not</i> going that route.
anulman大约 14 年前
I actually went through this recently. Here's what took me from zero-to-functional-prototype in 6 weeks.<p><i>Note: I had a </i>bit* of Python scripting experience, and knew my way around HTML and CSS.*<p>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.<p>2. I used an old tutorial for rolling my own user model from scratch (still in the Sitepoint piece): <a href="http://www.aidanf.net/rails_user_authentication_tutorial" rel="nofollow">http://www.aidanf.net/rails_user_authentication_tutorial</a><p>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.).<p>If you're not coming into this with any scripting experience, I would absolutely recommend checking out <a href="http://tryruby.org/" rel="nofollow">http://tryruby.org/</a> first.
sayemm大约 14 年前
I just started learning RoR recently. As mentioned in the other comments, Michael Hartl's "Ruby on Rails Tutorial" (<a href="http://ruby.railstutorial.org/ruby-on-rails-tutorial-book" rel="nofollow">http://ruby.railstutorial.org/ruby-on-rails-tutorial-book</a>) and the Rails Guides (<a href="http://guides.rubyonrails.org/" rel="nofollow">http://guides.rubyonrails.org/</a>) are all you need.<p>The Railscasts are a great resource as well - <a href="http://railscasts.com/episodes/archive" rel="nofollow">http://railscasts.com/episodes/archive</a><p>And a good starting resource for Ruby is the pickaxe book - <a href="http://www.amazon.com/Programming-Ruby-1-9-Pragmatic-Programmers/dp/1934356085/ref=sr_1_2?ie=UTF8&#38;qid=1301754318&#38;sr=8-2" rel="nofollow">http://www.amazon.com/Programming-Ruby-1-9-Pragmatic-Program...</a>
minouye大约 14 年前
I am a "business guy" who was proficient in PHP. Here's what I did:<p>- Bought a beginning Ruby book and gave it a quick perusal to get a handle on the fundamentals<p>- 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.)<p>- 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大约 14 年前
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.<p>What really astounds me is that people take ActiveRecord at face value and do stupid things such as Foo.all.sort_by(&#38;:blah) or Foo.all.select {|x| x.stuff == "term"} and don't understand why it's such a bad idea.
Luyt大约 14 年前
Well, with _why the Lucky Stiff's 'Poignant Guide to Ruby' of course ;-)<p><a href="http://en.wikipedia.org/wiki/Why_the_lucky_stiff" rel="nofollow">http://en.wikipedia.org/wiki/Why_the_lucky_stiff</a><p>One of the developers in the video suggested to learn some Ruby first before diving into Rails.
kujawa大约 14 年前
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.<p>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.<p>Think I'm exaggerating?<p><a href="http://code.macournoyer.com/thin/doc/files/README.html" rel="nofollow">http://code.macournoyer.com/thin/doc/files/README.html</a>
kongqiu大约 14 年前
Starting from zero, I found Michael Hartl's Ruby on Rails 3 Tutorial to be excellent. YMMV.
nraynaud大约 14 年前
"Seven Dwarf Mine Station" ?
farout大约 14 年前
here are the three that within in a month you should be able to write some sweet apps quickly.<p>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.<p>2. I loved Agile Programming book - totally awesome. Not enough apps though. Great explanations. Gentle exposure to Ruby.<p>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!!<p>Now you have the grounding, start making and asking questions.<p>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.<p>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.<p>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.
评论 #2401719 未加载
insight大约 14 年前
tar xzvf Django-1.3.tar.gz
评论 #2400108 未加载