The Camping Tutorial

This tutorial is five pages long and takes about ten minutes. By the end you should have a little Camping site up. The last couple of pages is all database stuff, so you can quit a little early if you won't be using a database.

First, Install

You must have Ruby and RubyGems installed. Once they are installed, open a command prompt and run:

# gem install camping -y

Voila.

Camping in Emptiness

Start a new text file called nuts.rb. Here's what you put inside:

 #!ruby
 Camping.goes :Nuts

Save it. Then, open a command prompt in the same directory. You'll want to run:

$ camping nuts.rb

You should get a message which reads:

 ** Camping running on 0.0.0.0:3301.

This means that right now the Camping server is running on port 3301 on your machine. Open a browser and visit http://localhost:3301. Or, if you are running Camping on an entirely different machine, use the IP address instead of localhost.

Your browser window should show:

Camping Problem!

/ not found

No problem with that. The Camping server is running but it does not know what to show. We'll tell him.


Continue to TheCampingTutoralTwo