SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Member
    Join Date
    Oct 2005
    Location
    Silicon Valley
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Trouble with Rails setup

    I have a strong php/mysql background, but I've never worked with ruby before. I've been messing around with trying to get rails working on my server.

    I got as far as generating a webapp with the "rails" command and getting the "congratulations, you're on rails" page to work. But every time I ./script generate somecontroller and ./script generate somemodel, the script executes successfully, but I get no new controller.

    http://server/railsapp/somecontroller returns a 404, when it should be displaying the "hello world" message I set in it's def index in the controller rb file.

    I've followed quite a few tutorials, including this one ( http://darkhost.mine.nu:8080/~vince/rails/tutorial.html ) in exacting detail. I end up with the same problem every time. I generate controllers, they don't work. What gives? Is my Apache / ruby / rails setup borked? Did I miss something in the controller generation process?

    Notes:

    I get the same problem on Webrick as I do with Apache. I'd prefer to use Apache, as I'm using other scripting languages for other software.

    The error is a generic 404, as if the controller doesn't exist.

    The code is simply:

    Code:
    class WeblogController < ApplicationController
        model :weblog
        def index
            render_text "Hello World"
        end
    end
    And "map.connect ':controller/:action/:id'" is present in routes.rb.

    Is there something else I can check that might be causing both webservers to throw 404s?

  2. #2
    eschew sesquipedalians silver trophy sweatje's Avatar
    Join Date
    Jun 2003
    Location
    Iowa, USA
    Posts
    3,749
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did you do:

    ruby script/generate model Something

    ?
    Jason Sweat ZCE - jsweat_php@yahoo.com
    Book: PHP Patterns
    Good Stuff: SimpleTest PHPUnit FireFox ADOdb YUI
    Detestable (adjective): software that isn't testable.

  3. #3
    SitePoint Member
    Join Date
    Oct 2005
    Location
    Silicon Valley
    Posts
    5
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yes, I generated a model for my controller.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •