Hello everyone,
I've just recently started learning Rails and have searched this forum to try and find an answer with no luck to this seemingly simple issue. I'm hoping someone out there might be able to help me get on the right track - so far it's been days just getting through the installation process on Mac 10.4 to the point where everything appears to work on the surface.
First of all, what I'm attempting to do is to go through the book Agile Web Development with Rails 2nd ed., from the beginning, to refresh everything. I'm up to page 36 and already I've hit a roadblock. Here's my steps:
1. ran "rails -d mysql test3app" to generate a new app. 2. ran "script/server" in the new directory. 3. ran "ruby script/generate controller Say" as instructed on page 36 of the Agile book. 4. Confirmed localhost:3000 was running in the browser and everything looks good. Got this output about my app:
Ruby version 1.8.6 (i686-darwin8.11.1) RubyGems version 1.0.1 Rails version 2.0.2 Active Record version 2.0.2 Action Pack version 2.0.2 Active Resource version 2.0.2 Action Mailer version 2.0.2 Active Support version 2.0.2 Application root /usr/local/src/test3app Environment development Database adapter sqlite3 Database schema version 0
5. Edited say_controller.rb to read the following:
class SayController < ApplicationController def hello end end
6. Pointed browser at http://localhost:3000/say/hello and got the following:
Routing Error No route matches "/say/hello" with {:method=>:get}
Was expecting:
Template is missing Missing template script/../config/../app/views/say/hello.rhtml (or .html.erb)
Any ideas?
These steps appear to work fine if I use Locomotive. However, I wanted to install everything from source so I'd have the latest version and benefit from all the great new stuff. I just can't figure out why this should be a problem in Rails 2 and fine in Locomotive's Rails v.1.2.x. So perhaps I did something wrong during the installation process, I have some ridiculous typo that I'm missing, or else there is some new way of writing a controller in Rails 2 that I'm not aware of. I've looked all day for an answer so here's to hoping someone can help me out here!
And happy new year everyone!
Cheers, Joe