Ubuntu on Rails: Getting up to speed with Ruby on Rails and Ubuntu

Posted on : 27-06-2005 | By : Tony Stubblebine | In : Uncategorized

Tags: , ,

1

I got my introduction to Rails with O’Reilly’s Rolling with Ruby on Rails article. Unfortunately, it’s very Windows oriented. Thankfully there’s great docs for getting everyting going on Debian or Ubuntu.

Install Ruby on Rails
The Ruby on Rails wiki provides a great tutorial. Basically, you apt-get install a bunch of ruby packages, manually install rubygems (a ruby module manager a la CPAN), and then use gems to install rails. I needed to have sudo to run most of the commands.

Read About Rails
You can start on page 2 of the O’Reilly Article, since the first page is all about installing on Windows. There’s more Windows-centricity to work around, see below.

The Webserver
The article recommends using the supplied webserver. I used that for now since I was more interested in getting a taste of Ruby than I was of Apache conf files. Initially I started the webserver in the background, but it spits a lot of output. You’ll probably want to redirect the output with a command like.

ruby script/server &> /tmp/rubylog

The Database
The article assumes a GUI MySQL admin interface. I prefer the command line. Here’s a sql file that handles all the table creations for you.

Gotchas
The database/model naming convention is goofy. Table names are plural, foreign keys singular, and models singular. That tripped me up. I’d much prefer the table names be singular so that they can match the foreign keys.

A lot of the commands in the article were written for a Windows server so some of the slashes are backwards.

Resources
Rolling on Rails, Part Two
Explanation of Minutae in the Rolling Articles
Programming Ruby, the book, online, for free.
Ruby on Rails site

Comments (1)

Re: Gotchas, I’ve always felt using plural table name is a bit of a novice error…

Write a comment