Amazing Java Developer Needs Help Getting Started

Hi guys,

I need to learn Ruby on Rails as fast as possible and very much wish
to start with 2.0. I'm really good at developing software with Java
and its associated tools and frameworks. What is the best path for me
to be productive with RoR? I went to www.rubyonrails.org and followed
the basic "Get Started" guide. Simple enough, downloaded and
installed Ruby, RubyGems and Rails, created a skeleton app, started
the server and visited http://localhost:3000. Everything looks good
so far. Very quick and easy to get up and running with a skeleton
application. I click on "About your application's environment" and
immediately get a database error. I read ruby on rails 2.0 uses
sqlite3, but I have no idea how to start or configure the server.
There's no documentation anywhere obvious in the rubyonrails.org site
or localhost:3000. I was able to figure out how to install sqlite3
using gem after viewing the database.yml file, so now I get an error
about a missing sqlite3.dll file. Ok I actually just read the
official weblog and see I need to install sqlite3, I thought ruby on
rails came with it? I'll do this later.

So, assuming I get sqlite3 installed or just install mysql or
postgresql, where do I go from here? Surprisingly, I don't see any
kind of documentation or tutorials for Ruby on Rails 2.0. The
official documentation webpage presents a list of books and tutorials
from 2006. Some tutorials are even from 2005! Obviously these don't
cover 2.0. And I understand there are lots of changes in 2.0, such as
no scaffolding (don't know what that is yet), different pagination
(again no idea what it is), session management, filenames, etc.

Can someone point me in the right direction please? I've heard so
many great things about ruby and rails, but to be honest I'm
definitely not impressed with the initial learning phase.

I train people a lot. The approach I take with people is to have them use Rails 1.2.3 and do the “Agile Web Development with Rails” book. See http://www.pragprog.com/titles/rails2

Install Rails 1.2.3 with

gem install --version=1.2.3 rails

Then to use Rails 1.2.3 for a project, use

rails 1.2.3 projectname

(The 1.2.3 part specifies which version of the Gem you’re going to use. If you leae that iff, it will use the most recent version (2.0).

The Agile book takes you through all of the stuff you need to learn about the basics of Rails. While some things have changed, you don’t need to know about all that as a beginner. Once you understand how the framework actually works, you can take a look at the “What’s New in Rails 2.0” mini-book from www.peepcode.com. Rails 2.0 took things out and moved them into plugins to make the framework lighter. That’s why none of the current books or tutorials really work well.

If you’re a competent programmer, this should be trivial. Rails 2.0 came out not that long ago, and while it has been in development for a long time, they neer announced when it was going to be released so a lot of the books aren’t quire done yet. There’s one book on Rails 2.0 that’s quite good, but I don’t really think it’s for beginners. It’s called “The Rails Way” by Obie Fernandez.

Best of luck!

Hi Brian,

Thank you for the advice. I did find a quick simple tutorial for
rails alone written a few days ago:
http://www.randomsyntax.com/2008/01/10/getting-started-with-ruby-on-rails-2-making-a-link-manager-part-1/
Though it makes use of scaffolding, something I read was removed in
rails 2.0. So I guess the author was mistaken about which version he
was writing this article for.

A lot of people keep saying that scaffold was removed. Let me be
clear: it was not.

Only the `scaffold` method which dynamically generated a scaffolding
for you was removed. You can still generate RESTful scaffolding just
like the article says.

--Jeremy

Right, in fact if anything generated scaffolding has gotten better
over time. For example, I think the ability to specify model
attributes and generating the migration, model, controller, routing,
..., all in one swell foop is relatively new, isn't it?

Not that I wouldn't like to see more improvements like being able to
generate scaffolding for an existing model, and/or support for
scaffolding nested resourceful controllers.

To that end, check out Brian's plugin: http://www.napcsweb.com/blog/2007/11/04/scaffoldform-generator/

Jeff
softiesonrails.com

Hi Jeremy,

Your Ruby in Practice book looks very good. That sounds like it would
suit my situation perfectly. Unfortunately it appears to only be
available in June. But the link you provide shows a Sept 2007 early
access release? Does that cover rails 2.0? Should I get this given I
know nothing about ruby or rails, but am a seasoned java developer?