Can't reach a controller :(

When I try to see a controller I get a 404 error, this is what WEBrick
says

What could it be? Thanks for the help :wink:

=> Booting WEBrick…
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2007-09-10 13:30:26] INFO WEBrick 1.3.1
[2007-09-10 13:30:26] INFO ruby 1.8.6 (2007-06-07) [i486-linux]
[2007-09-10 13:30:26] INFO WEBrick::HTTPServer#start: pid=6020
port=3000
127.0.0.1 - - [10/Sep/2007:13:30:48 CEST] “GET / HTTP/1.1” 200 7552

  • -> /
    127.0.0.1 - - [10/Sep/2007:13:30:48 CEST] “GET /javascripts/
    prototype.js HTTP/1.1” 200 71260
    http://localhost:3000/ -> /javascripts/prototype.js
    127.0.0.1 - - [10/Sep/2007:13:30:48 CEST] “GET /javascripts/effects.js
    HTTP/1.1” 200 38200
    http://localhost:3000/ -> /javascripts/effects.js
    127.0.0.1 - - [10/Sep/2007:13:30:48 CEST] “GET /images/rails.png HTTP/
    1.1” 200 1787
    http://localhost:3000/ -> /images/rails.png
    127.0.0.1 - - [10/Sep/2007:13:30:48 CEST] “GET /favicon.ico HTTP/1.1”
    200 0
  • -> /favicon.ico
    #<ArgumentError: Anonymous modules have no name to be referenced by>
    ["/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/
    dependencies.rb:404:in to_constant_name'", "/usr/lib/ruby/gems/1.8/ gems/activesupport-1.4.2/lib/active_support/dependencies.rb:214:inqualified_name_for’", “/usr/lib/ruby/gems/1.8/gems/
    activesupport-1.4.2/lib/active_support/dependencies.rb:476:in
    const_missing'", "/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/ dispatcher.rb:117:inreset_after_dispatch’”, “/usr/lib/ruby/gems/1.8/
    gems/rails-1.2.3/lib/dispatcher.rb:51:in dispatch'", "/usr/lib/ruby/ gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:113:inhandle_dispatch’”, “/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/
    webrick_server.rb:79:in service'", "/usr/lib/ruby/1.8/webrick/ httpserver.rb:104:inservice’”, “/usr/lib/ruby/1.8/webrick/
    httpserver.rb:65:in run'", "/usr/lib/ruby/1.8/webrick/server.rb: 173:instart_thread’”, “/usr/lib/ruby/1.8/webrick/server.rb:162:in
    start'", "/usr/lib/ruby/1.8/webrick/server.rb:162:instart_thread’”,
    “/usr/lib/ruby/1.8/webrick/server.rb:95:in start'", "/usr/lib/ruby/ 1.8/webrick/server.rb:92:ineach’”, “/usr/lib/ruby/1.8/webrick/
    server.rb:92:in start'", "/usr/lib/ruby/1.8/webrick/server.rb:23:instart’”, “/usr/lib/ruby/1.8/webrick/server.rb:82:in start'", "/usr/ lib/ruby/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:63:indispatch’”, “/usr/lib/ruby/gems/1.8/gems/rails-1.2.3/lib/commands/
    servers/webrick.rb:59”, “/usr/local/lib/site_ruby/1.8/rubygems/
    custom_require.rb:27:in gem_original_require'", "/usr/local/lib/ site_ruby/1.8/rubygems/custom_require.rb:27:inrequire’”, “/usr/lib/
    ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/
    dependencies.rb:495:in require'", "/usr/lib/ruby/gems/1.8/gems/ activesupport-1.4.2/lib/active_support/dependencies.rb:342:innew_constants_in’”, “/usr/lib/ruby/gems/1.8/gems/activesupport-1.4.2/
    lib/active_support/dependencies.rb:495:in require'", "/usr/lib/ruby/ gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39", "/usr/local/lib/ site_ruby/1.8/rubygems/custom_require.rb:27:ingem_original_require’”, "/usr/local/lib/site_ruby/1.8/rubygems/
    custom_require.rb:27:in require'", "script/server:3"] [2007-09-10 13:30:51] ERROR/say/hello’ not found.
    127.0.0.1 - - [10/Sep/2007:13:30:51 CEST] “GET /say/hello HTTP/1.1”
    404 279
  • -> /say/hello

first of all, there could be a million reasons why this webrick isn’t
running correctly, starting from the method not being there to
permissions on your server, etc etc .

it looks as if you tried reaching

localhost:3000/say/hello .

what controller are you trying to access? according to default rail
values (assuming u didn’t change anything) you should be trying to
access a controller class SayController with the action hello being
defined. (ie, you should have in your controllers/ folder a file called
something like * with ->

say_controller.rb

class SayController < ApplicationController

stuff


.
def hello
#…some good code here
end

end

is this your case so far?

Yes, exactly, I have generated the controller using the script and I
have an action defined on the controller (actually, is the example of
the agile development with rails book). I haven’t changed anything of
the settings of rails, and I’ve tried with an Apache server and it was
a 404 too

thanks for the answer

On 10 sep, 15:17, Shai R. [email protected]

I’ve been thinking about it, and I tried with the rails package from
the debian repository, instead of the rails from gems

Now, it works properly. Thanks for the help anyway.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs