Ruby on Rails: Hello World
That's strange. I just repeated your steps exactly and got it to work (using rails 3.2.3 and ruby 1.9.3-p0) and when visiting localhost:3000/common I got the "Hello World."
Here's what I'd try real quick, to make sure it's not a problem with your setup:
1) cd inside your rails project directory
2) issue these terminal commands
rails g scaffold user name:string email:string
rake db:migrate
3) visit this urlhttp://localhost:3000/users
If your rails is setup correctly, you should see this
If these steps don't work, then something weird seems to be going on with your setup.
Also, be sure to remove the public/index.html
file from your app. If you don't remove it, you won't be able to see your custom root page, which you specified in your routes file.
If above doesn't work, maybe a problem with your Ruby version?
Hope this helps!
Wow. I actually just stumbled upon the actual root problem:
I was creating my project within a folder that had a bracket in the name -- that is, I was running "rails new web" from within "/coding/workspace/[My] Toolbag".
Tonight I happened to try once more in "/coding/workspace", and it finally worked. So then I tested "rails new web" from within the following locations to flesh out my suspicion:
/coding/workspace/test1/coding/workspace/test 2/coding/workspace/test [3]/coding/workspace/test [4/coding/workspace/test ]5/coding/workspace/test [6/subfolder
Suspicion confirmed. Rails projects within folders 3,4,6 demonstrate the problem I described in this question, while rails projects within folders 1,2,5 work just fine.
Specifically, the problem is an open bracket anywhere in the path: "["
I'm using Linux Mint. The problem might apply even more broadly, though I haven't yet attempted to repro on other distros, Windows, or Mac.
With many thanks to Brett Sanders for all of his repeated assistance and confirmation that I my approach should have been correct, I'm submitting this answer and marking this one as correct, in case anyone else encounters the same issue.