Getting Ryan on Rails - Part 1
I’ve been yammering away about how good rails in over the past few weeks (and months) and even helped a few people get started with it, the other day my friend Ryan asked me to help him get into it, so I thought I’d share my advice with everyone.
So here goes, my guide to getting into rails from scratch.. I’m going to try and keep it simple to begin with, there are a lot of tutorials out there already but I found some really basic things kept tripping me up as the writers glossed over it. I might forget or ignore or even over simplify things sometimes, but when your getting started I’m sure it’s not huge issue.
Installing Rails
The first thing to do is get ruby, rails and mysql installed on your computer, this is a platform dependent step, so follow the tutorial link for your specific OS:
- Mac OS X - This tutorial by Hive Logic is by far the best way to set up everything on your mac, but if you are feeling lazy or not quite sure if you are going to like it try Locomotive but you’ll still need MySQL for your database.
- Windows - There is an awesome tutorial on All About Ruby will tell you everything you need to get windows on rails, alternatively you can grab InstantRails and you don’t have to install anything, in a similar to Locomotive.
- Linux - This tutorial should sort you out when it comes to Ubuntu, and this one for Fedora, I don’t think there is an equivalent to Locomotive on Linux but you might be able to run InstantRails under Wine
Getting started
So now that you’ve got everything set up it’s time to get started:
These commands are based on using Mac OS X which both Ryan and I are using, the windows commands may be slightly different.
First up we get rails to generate the shell of our application, open up your terminal and enter the code below, you can do it from anywhere in the file system but your home folder is a good idea.
$ rails my_app
That’s the magic one, a load of files and folders have been created in my_app, again you should use the name of your application in place of my_app.
Let’s now change into our newly created directory:
$ cd my_app
Next we’ll can check if everything is working properly by firing up the websever:
$ script/server
This will start up the webrick server (or mongrel or lighttpd depending on what you installed) now open up your web browser of choice and got to http://localhost:3000 and you should see this:
Hopefully everyone got that, it’s the default index page for a rails application and means that the server is running properly, now that we’ve got those things out of the way we can get started on the fun stuff.
Next time: Setting up your database, using migrations and scaffolding.




nice! there’s an Ubuntu LiveCD out there with ruby/rails/mysql set up also. can’t really save anything too easily, but if you just want to play…
http://www.railslivecd.org/
The Technocrat on April 16, 2007 3:19 pm
Great one again dan
Andrew on April 16, 2007 3:20 pm
Eagerly awaiting part 2! Thanks, always was interested in rails.
Sasha on April 18, 2007 8:02 pm
It’s coming soon, once Ryan has finished the first step
Andrew on April 19, 2007 11:23 am
So where’s part 2?
Gary on July 18, 2007 5:26 pm
[…] So first up, this is MAC ONLY, sorry windows chaps you’ll have to look else where. I have a list of some other good windows tutorials here. […]
Teabass - Andrew Nesbitt's Blog » Super Simple Ruby on Rails with MacPorts on October 22, 2007 7:07 am