Ethan Gunderson
Ethan Gunderson

Reputation: 11487

Learning Ruby on Rails

As it stands now, I'm a Java and C# developer. The more and more I look at Ruby on Rails, the more I really want to learn it.

What have you found to be the best route to learn RoR? Would it be easier to develop on Windows, or should I just run a virtual machine with Linux?

Is there an IDE that can match the robustness of Visual Studio? Any programs to develop that give a good overhead of what to do? Any good books?

Seriously, any tips/tricks/rants would be awesome.

Upvotes: 241

Views: 191962

Answers (30)

dodgy_coder
dodgy_coder

Reputation: 13033

I have got up to speed with Ruby on Rails fairly quickly via this free online course which is currently being offered by UC Berkeley - Software as a Service - Engineering Long Lasting Software with instruction by Armando Fox and David Patterson. I can't speak highly enough of this course... it really was a privilege to learn Rails from these guys. And there is an active community on the course forums if you run into difficulty along the way. The first offering of the online course has now finished (as of 25 March, 2012) - the next time it will be run will be sometime in September of 2012.

It assumes you are a fairly competent developer and gets you started on ruby in the second week, then Rails runs from the third week up to the end of the course (five weeks). Your assignments are marked by an auto-grader. You get provided with a pre-built Ubuntu VM image with everything you need for development pre-installed on it (e.g. Ruby, Rails, Rake, Gems, RSPec, Cucumber, etc). All you have to do is start up the VM inside the (free) VirtualBox software which runs on MacOSX, Windows and Linux.

There is a recommended text book for the course ... here ... but you may be able to get by looking at the lectures and screencasts online.

Upvotes: 0

A4J
A4J

Reputation: 889

I asked the same question when I started out - hoping for a somewhat prescriptive guide on learning Rails... couldn't find one so decided I would write one for others who might find themselves in a similar boat one day :) You can find it here:

Best Way to Learn Ruby & Rails

(It's now actually returned with the !learn factoid helper in the official Ruby on Rails IRC chat room.)

Upvotes: 0

Jay Godse
Jay Godse

Reputation: 15503

A lot of good opinions here. I'll add what's not here. My experience:

  • Rails on Windows is easy to get going with RailsInstaller, especially if you're using SQLite.
  • If you want to use Ruby gems which need C extensions (e.g. RMagick), installation is difficult and unpredictable.
  • PostgreSQL is a pain to install on Windows, and a pain to hook up to Rails.
  • git doesn't work quite right on Windows.
  • IDEs are bulky (Aptana). Notepad++ is good enough.
  • Rails on Ubuntu is easy, and gems requiring C libraries just work.
  • If your computer is powerful enough, use VirtualBox or VMWare Player, and use an Ubuntu Virtual Machine.

Setup Resources

  • This page shows, start to finish how to set up Ruby/Rails/PostgreSQL on Ubuntu 11.10.
  • If you don't like RVM (I don't), use rbenv. RVM and rbenv are tools for managing multiple versions of Ruby, including JRuby, Rubinius, etc.

Live Deployment for Development/Testing

  • Live deployment lets your friends try out your app. It also makes it easier to interact with web services which need to make callbacks to your Rails server (such as PayPal IPN or Twilio).
  • Heroku.com is my favourite place to deploy.
  • localtunnel.com is a good utility to point a publicly visible URL to your local Rails server. (I have only used it for Windows-based Rails servers).

Learning

  • Try out tutorials on the web.
  • Use stackoverflow.com to ask questions.
  • Use "raise Exception, params.to_s " in your Controllers to stop the app print out all the parameters which are driving your controllers. This gave me the greatest insight on how data is schlepped back and forth in a Rails app.
  • Use the Rails console ("rails console") to inspect data, and try out code snippets before you embed them in your models or controllers.

Upvotes: 1

Steve McKinney
Steve McKinney

Reputation: 3361

I used to do Java and C# on Windoze.

I'd second these sources:

IDE: Try Apatana RadRails 3 Sneak Peek: http://www.radrails.org/3. Its the closest thing you'll get to Visual Studio. I play with it here and there but still love the lightness of Textmate.

OS: Mac OS gets the most if not all love from Ruby community. Anything else is treated like a bastard child.

Books:

  • The Pragmatic Programmers' Guide (the pickaxe book)
  • Agile Web Development with Rails

Screencasts:

  • Peepcode (pay) is a nice way to pick up concepts quickly
  • Railscasts (free) is a good weekly way to pick up new gems and concepts incrementally
  • Railscasts (pro) is also a good way to pick up concepts for a pretty low price.

Upvotes: 3

DemitryT
DemitryT

Reputation: 391

I program with RoR on the Mac OS with textmate, and it's awesome.

I would suggest "Programming Ruby 1.9" (The Pickaxe Book) for Ruby and Agile Web Development with Rails" to learn Rails, both published by the Pragmatic Bookshelf.

Good luck!

Upvotes: 0

astjohn
astjohn

Reputation: 2942

Without a doubt

Agile Web Development with Rails

and

The Rspec Book

and for fun

Advanced Rails Recipies

  • I would link to the other two, but Stack Overflow won't let me. See the same site.

Upvotes: 1

scottru
scottru

Reputation: 5360

My suggestion is just to start - pick a small project that you would generally use to learn an MVC-style language (i.e. something with a database, maybe some basic workflow), and then as you need to learn a concept, use one (or both!) of

Agile Web Development with Rails or The Rails Way

to learn about how it works, and then try it.

The problems with Agile Web Development are that it's outdated, and that the scenario runs on too long for you really to want to build it once; The Rails Way can be hard to follow as it bounces from reference to learning, but when it's good, it's better than Agile Web Development.

But overall they're both good books, and they're both good for learning, but neither of them provide an "education" path that you'll want to follow. So I read a few chapters of the former (enough to get the basic concepts and learn how to bootstrap the first app - there are some online articles that help with this as well) and then just got started, and then every few days I read about something new or I use the books to understand something.

One more thing: both books are much more Rails books than they are Ruby books, and if you're going to write clean code, it's worth spending a day learning Ruby syntax as early as possible. Why's Guide to Ruby is a good one, there are others as well.

Upvotes: 2

Jason Navarrete
Jason Navarrete

Reputation: 7523

I've been moving from C# in my professional career to looking at Ruby and RoR in my personal life, and I've found linux to be slightly more appealing personally for development. Particularly now that I've started using git, the implementation is cleaner on linux.

Currently I'm dual booting and getting closer to running Ubuntu full time. I'm using gedit with various plugins for the development environment. And as of late 2010, I'm making the push to use Vim for development, even over Textmate on OS X.

A large amount of the Rails developers are using (gasp) Macs, which has actually got me thinking in that direction.

Although I haven't tried it, Ruby in Steel gives you a Ruby IDE inside the Visual Studio world, and IronRuby is the .NET flavor of Ruby, if you're interested.

As far as books are concerned, the Programming Ruby (also known as the Pickaxe) book from the Pragmatic Programmers is the de-facto for learning Ruby. I bit the bullet and purchased that book and Agile Web Development with Rails; both books have been excellent.

Peepcode screencasts and PDF books have also been great for getting started; at $9 per screencast it's hard to go wrong. I actually bought a 5-pack.

Also check out the following:

I've burned through the backlog of Rails and Rails Envy podcasts in the past month and they have provided wonderful insight into lots of topics, even regarding software development in general.

Upvotes: 205

Binil Thomas
Binil Thomas

Reputation: 13779

IDE: NetBeans
Book: Agile Web Development With Rails
Installation: Instant Rails

Upvotes: 13

Søren Spelling Lund
Søren Spelling Lund

Reputation: 1662

I really enjoy RubyMine from Jetbrains. It seems like a very full featured IDE something I miss from many of the other alternatives out there. Also for a simple env I enjoy e the text editor. Plain and simple.

Upvotes: 14

Scott Schulthess
Scott Schulthess

Reputation: 2923

The fastest way to learn anything, Ruby on Rails included, is pair programming.

Find someone who knows Rails, pick an example app, sit down, and work through fixing bugs, adding features.

The knowledge sharing is unbelievable.

Upvotes: 2

Sean
Sean

Reputation: 2891

Fantastic decision! It is extremely useful to get a grounding in Ruby before going to Rails so here is my take on the best path to Rails:

Aside from books the most important thing is to get feedback on what you are doing. To do this I recommend spending time in irc.freenode.net #ruby and #rubyonrails. It is also extremely helpful to post things you are working on or having trouble with here on stackoverflow as the comments, explanations and different way of thinking about things that people provide are invaluable.

You should also definitely check out the Ruby Rogues podcast, they provide invaluable information and the commentators are all extremely respected people in the Ruby community. And for your viewing and reading pleasure (in that order,) head over to Ryan Bates's Railscasts and then Eifion Bedford's Asciicasts.

Finally, I recommend looking into different gems on github, reading the code and then contributing to them. You don't have to get overly ambitious and do massive recodes, especially at first. Just start with small things like editing and making the README files a little easier to read.

I don't use an IDE but at Railsconf I saw a demo of Rubymine from Jetbrains and it seemed pretty amazing.

Upvotes: 7

B Seven
B Seven

Reputation: 45943

I agree with srboisvert. Don't do it on Windows. You can add Ubuntu (version of Linux) to Windows and have dual boot. It requires some work, but it is easier than going against the grain and trying to get everything working on Widows.

Ubuntu, Heroku and Git work wonderfully. Just know the learning curve is steep at first. Hire someone from Guru.com or Elance to help you.

Also, running Textmate on Mac is the preferred solution, so if you are considering getting a Mac or have access to one, that is the best thing to do. I don't think you need very much computing power...

Finally, my favorite book is Agile Web Development for Rails. Googling around doesn't work so well because most of the information is from old versions of Rails and is deprecated or doesn't work.

Upvotes: 0

dtt101
dtt101

Reputation: 2141

Just to +1 Agile Web Development with Rails (though make sure you get the latest edition) - http://pragprog.com/

I develop on a Mac and this can soemtimes be beneficial - it's quite a popular platform with Rails developers so many of the blog posts you look at will be mac-orientated. Linux is great too though ;)

Finally - and I have no connection with the company at all - when you do have something you want to put live, heroku is a good choice. Finding a cheap rails host isn't easy so this is a nice starting point. There are a lot of other great hosts out there too though! Heroku does kind of require git for version control (though you can use it on top of subversion).

Best of luck!

Upvotes: 1

Kombo
Kombo

Reputation: 2371

I'm learning Rails now and if you're using Windows (assuming so with C# dev) I highly suggest learning on Linux if investing in a Mac is not an option.

If you don't want to to create a separate Partition on your HDD for Ubuntu, I suggest checking out Wubi, a Windows installer for Ubuntu. The Rails experience is much less of a headache on Ubuntu than it is Windows and I'd argue is similar to that of an OSX dev environment, just not as much application support. I'm currently using a alpha text editor Redcar, which allows you to have some of textmate's functionality, the popular OSX editor.

Good books I've read on Rails are Beginning Rails 3 by Cloves Carneiro Jr and Rida Al Barazi. Also Rails Test Prescriptions by Noel Rappin, about developing in a test-driven approach.

My favorite things to keep me moving from amateur to notive are Railscasts by Ryan Bates. He usually releases a screencast every Monday or so about Rails gems, or recently Sass, SCSS, Coffeescript and technologies related to Rails 3.1.

A must read for any beginning programmer I feel is why's (poignant) guide to ruby. Unfortunately _why disappeared just as I was getting into Ruby, but his content is still scatter accross various sources. It has quirky humor and by the end you'll know Ruby's syntax quite well.

Upvotes: 0

Parsuram Vijay
Parsuram Vijay

Reputation: 1

This is also a good read http://guides.rubyonrails.org/

Upvotes: 0

tedi
tedi

Reputation: 11

Some awesome advice here!

Some of the resources I will list have been mentioned, some I don't think were. I am definitely still not a pro, I've just been learning for the past few months and I've been improving at a rapid rate. This is what helped me in order:

  1. Why's poignant guide to ruby: excellent introduction to the Ruby language by the infamous _why.
  2. Agile web development with rails book: great book with some good in-depth follow alongs
  3. Rails tutorial by Michael Hartl (railstutotrial.org): this has been my favorite resource. Hartl's style of walking you through demo apps and explaining everything just made things click for me.
  4. Rails for Zombies - ran through this twice, great for reinforcing the basics.
  5. Railscasts - I started following this along at first, but they were not helpful until now that I am just really starting to grasp Rails. I would leave these for the end after you have got your feet wet.
  6. Think Vitamin's rails tutorials were also pretty good. I followed along these screen casts at first, to feel out the language and then did them again towards the end.
  7. The "Learning Rails" podcast, although outdated (Rails 2) was also a good starting resource. I listened to this while driving/working out.

I hope that was helpful! I'm far from being a pro, but I dove in head first and absorbed as much as I could from multiple resources. The ones I mentioned above were the most helpful!

Oh and what's really helping me now is coming up with personal projects and settings certain tasks. Following along is great, but you truly learn when you dive in without a guide!

Upvotes: 0

Attila Györffy
Attila Györffy

Reputation: 759

I've seen the infamous "Blog in 15 minutes" video ages ago when Rails was probably around version 1.0 or something like that. One of the most important things about the Ruby/Rails world is that given it's great community it's changing ridiculously fast in comparison to other frameworks.

Today, Rails is significantly different that what it used to be, altho the main ideology has been kept the same. Having said that event tho in the lsat few years I've learnt a lot of things about Rails I still keep learning new things about it.

The most valuable resources to me that help me discovering and keeping up with the latest ways of doing Ruby and Rails are the following:

  • Rails Guides - A nice way of learning Rails itself, edited by the community, moderated by the core contributors. The site has a lot to offer on most of the important main topics around Rails that it can get you up and running very quickly. It covers bot the most recent stable and edge versions of the framework.

  • If you understand the main ideology of Rails than I definitely recommend checking out (and subscribing to) Ryan Bates' Railscasts. Let me just quote from the site itself, I think it's pretty self explanatory:

    Every week Ryan Bates will host a new Railscasts episode featuring tips and tricks with Ruby on Rails. These screencasts are short and focus on one technique so you can quickly move on to applying it to your own project. The topics target the intermediate Rails developer, but beginners and experts will get something out of it as well.

  • There are also a lot of podcasts around Ruby/Rails, the two that I keep listening to are Ruby5 and the Ruby Show.

  • For more specific questions like API calls etc, I'd recommend APIDock's Rails and Ruby sections where you can get more information on specific methods.

  • If you are getting more familiar with the framework, it's worth taking a look at Rails Best Practices. There's a bunch of short articles on certain issues that most people make in the beginning of their learning curve with Rails. This site is meant to point pot these issues and help beginners finding their way towards writing better and more well thought out code. There's also a gem that you could use which scans your application and points out these issues and offers solutions/workarounds. Pretty neat!

These resources should help you in getting up and running with Rails. Good luck with your journey to the Rails world and welcome to the community.

Upvotes: 1

Soner Gönül
Soner Gönül

Reputation: 98740

  1. Data Structures and Algorithms with Object-Oriented Design Patterns in Ruby Bruno R. Preiss | Published in 2004

  2. Learn to Program Chris Pine | Pragmatic Bookshelf Published in 2006, 176 pages

  3. Mr. Neighborly's Humble Little Ruby Book Jeremy McAnally | Published in 2006, 147 pages

  4. Programming Ruby: A Pragmatic Programmer's Guide David Thomas, Andrew Hunt | Addison-Wesley Published in 2000, 608 pages

  5. Rails in a Nutshell C. Fauser, J. MacAulay, E. Ocampo-Gooding, J. Guenin | O'Reilly Media Published in 2009, 352 pages

  6. Ruby Best Practices Gregory T. Brown | O'Reilly Media Published in 2009, 328 pages

  7. Ruby Essentials | Techotopia Published in 2007

  8. Ruby on Rails Security Heiko Webers | OWASP Published in 2009, 48 pages

  9. Ruby User's Guide Mark Slagell | Published in 2005

  10. The Book Of Ruby Huw Collingbourne | Published in 2009, 425 pages

  11. The Little Book of Ruby Huw Collingbourne | Dark Neon Ltd. Published in 2008, 87 pages

  12. why's (poignant) guide to Ruby why the lucky stiff | Published in 2008

Upvotes: 12

wizztjh
wizztjh

Reputation: 7041

http://railsforzombies.org/ is a nice one. Introducing an all new way to learn Ruby on Rails in the browser with no additional configuration needed.

Upvotes: 9

Nathan Long
Nathan Long

Reputation: 125882

To learn Ruby, read "The Well-Grounded Rubyist" by David Black. It is extremely clear, well-written, and well-organized. The best technical book I've ever read (out of maybe a dozen, since I'm a relatively new programmer).

To learn Rails, read "Head First Rails." They explain how all the mysterious parts work together. Be patient with the silliness and work your way through the examples - it will pay off. (Also, for consistency, use whatever version of Rails they use. You can upgrade later.)

Both of these books assume little to no knowledge on your part, regarding OOP programming and MVC architecture. If you do know a bit, don't skim, because you might assume things incorrectly. (For instance, Ruby objects don't have public attributes, only getters and setters. But you can automatically create multiple getters/setters with a single line like attr_accessor :attr1, :attr2, :attr3.)

Upvotes: 1

SiliconChaos
SiliconChaos

Reputation: 86

I've found http://railstutorial.org/book to be a great resource for learning Rails

Upvotes: 20

nuclearsandwich
nuclearsandwich

Reputation: 455

I'm surprised there has been so little mention of Why's (Poignant) Guide to Ruby. Why may not be around anymore but the guide is easy to find on the net (Google points here first) it's a very easy read and provided my introduction to Ruby.

After the guide, I'd recommend either one of the books the others have suggested, or following the series of screencasts at Learning Rails which is how I picked up enough Ruby on Rails to be dangerous. Once you've completed the Learning Rails series. what you want to do with Rails will start to diverge from the general tutorials and that's where Railscasts becomes a wonderful tool. There's not much can be done with Rails that Railscasts hasn't touched on at some point.

Upvotes: 5

Marc Bollinger
Marc Bollinger

Reputation: 3119

My first suggestion would be to learn a little about symbols first. Rails isn't the smallest framework ever, and while there's definitely lots to learn, most of it will start to make sense if you have at least a little bit of understanding what makes it different ("special") from other languages. As pointed out, there's no exact analog in any of the major languages, but they're heavily used by Rails, in order to make things read straightforwardly and perform well, which is the reason I brought it up. My very first exposure to Rails was also my first time looking at Ruby (well before 2.0), and the first thing that caught my eye was the goofy :things they were passing around, and I asked, "WTF is that?"

Also, check out RubyQuiz, and read other peoples' answers on that site.

Upvotes: 4

Matthew J Morrison
Matthew J Morrison

Reputation: 4403

Find a nearby Ruby users group and start attending that. I've found that is a great way to meet a lot of people who are passionate about development and willing to teach.

Upvotes: 5

stephenr
stephenr

Reputation: 1173

The Book Agile Development with Rails is the number one teaching aid. It's got a nice life-like(ish) application it builds up through the chapters as it introduces you to different concepts. I worked through the examples twice, after which I had enough knowledge to do my own stuff and rely on the rails API documentation (http://api.rubyonrails.org/).

Upvotes: 1

Jagira
Jagira

Reputation: 1368

I come from a non-programming background. I have learned PHP on my own and recently joined a firm that specializes in Ruby on Rails. They have a comprehensive Rails training program, which is flexible enough to accommodate whatever changes we want to implement. Though I am not a rails pro, I would like to share my experience with rails. I hope that it helps.

Here is the path I am following [combined with tools I am using]

  • Start with a simple ruby guide. It will help a lot, since entire rails framework revolves around classes and objects.
  • Environment and OS are not important. Though I am working on a Mac, I frequently work on Linux and Windows, and I do not face any problems.
  • Start with a good book which explains using a demo app. [I am using Agile Web Development with Rails - By The Pragmatic Bookshelf]. There are many other good books as well.
  • Once you are done with the application, you will have a good idea of the framework.
    • Try to understand the SQL queries generated by Active Record module.
    • Go through the Rails Guides. You will find the framework a lot easier.
  • Keep practicing.

Few imp points

  • It takes years to learn a language completely. So be patient and do not stop learning.
  • Go through rails api as when required. [While developing your first app]
  • Google the things which you do not understand. People have written great articles on almost all topics.
  • Use Stackoverflow :-) [Only when you are not able to find the solution on your own.]
  • Load railscasts on your phone or video player. Watch 'em while travelling or in your free time. They are of few minutes each. You will learn a great deal of things and also learn the best way of doing things.

Tools

  • Shell [in Mac and Ubuntu]
  • Editor [Textmate in Mac, Gedit in Ubuntu and Notepad++ in Windows]
  • Firefox with Firebug installed for testing.

Finally I have one thing to say "Keep trying". All the best.

Upvotes: 2

user78706
user78706

Reputation:

I bought the book "Simply Rails 2" by Patrick Lenz.
This book is a great introduction to Ruby and Ruby on Rails.
As for my ruby installation and db, I used Cygwin.
It comes with PostgreSQL, ruby and svn.
I like PostgreSQL because I come from an Oracle
background so it feels more comfortable than MySQL.

The other utility I found really useful was pgAdmin
for accessing the PostgreSQL databases.

The first thing I needed to do was to get gems installed.
I got the gems tar file from rubyforge
wget "http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz"

Once I had gems setup, I installed

rails
ruby-postgres
postgres
rack

I also needed an issue tracking system so I installed redmine.
wget "http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz"

I found that using a UNIX-like environment (Cygwin) was
preferable in my case because many of the tutorials were
taylored for OS X or Linux.

The text editor I use is Textpad. I'm looking for an alternative. I think that vim with the rails plugin might work nicely.

Upvotes: 2

Kevin Pang
Kevin Pang

Reputation: 41442

There's a very solid ongoing series on NETTUTS right now that you may be interested in.

Upvotes: 9

Related Questions