Topic: 404 / "The page you were looking for doesn't exist."

Hi everyone,

I'm new to RoR and newer to Fedora Core 6.  I've used rails in Windows before but I've been looking for a better environment to run things in, and I decided to put up a simple FC6 server at home with RoR.

For the most part, I've been following this tutorial:

http://legacy.not404.com/cgi-bin/trac.f … RailsOnFC6

It seems like the best and most descriptive one out there for FC6.  But yup, you guessed it, I'm still running into problems.

I've gotten to the point where everything seems to be working fine with the index.html from the public folder showing when I point the browser to the web app, but, when I try to navigate to a controller or a function, I get "The page you were looking for doesn't exist."

How do I find out what's wrong?  I've tried to redo the tutorial a few times but to no avail.

Thank you for you support.

Re: 404 / "The page you were looking for doesn't exist."

Check the log file - there may be some clues there.

You might want to try deleting the index.html page and setting up a default route.  Somewhere near the top of config/routes.rb put:

map.home '/', :controller => 'my_controller'

Re: 404 / "The page you were looking for doesn't exist."

Thanks for the reply!

I've tried what you said and a bunch of other stuff (you'll find the different versions below, note that I didn't try it all at one time):

map.connect '', :controller => "say", :action => "hello"
map.connect '', :controller => "say"
map.home '/', :controller => "say", :action => "hello"
map.home '/', :controller => "say"

I also put a def index in say that calls def hello but nothing happens.. the weird thing is, when I go to say/hello, I see the render_text that I called.

So things work.. but not too well.  Would you know why I don't see the normal error that's normally shown - the Rails error page?

Thanks

Re: 404 / "The page you were looking for doesn't exist."

I emailed Laurence, the guy that made the tutorial, and he replied with the message below.  I still haven't fixed the problem.  Maybe some of you guys would like to take a crack at it smile

Laurence wrote:

About the 404 error message you're getting.. it sounds
like you may have missed something in the
lighttpd.conf changes.  The "/testapp" in the
lighttpd.conf's proxy.server section is what you
should be hitting in your browser
(http://localhost/testapp).

If you make the above changes and start getting 503
errors, chances are you need to reconcile the
lighttpd.conf's proxy.server "ports".  503s would mean
that lighttpd is sending requests out to the wrong
port numbers.

Getting an error on the find..sudo line.. perhaps you
didn't do a visudo?  If so, you might want to just su
to root so you don't have to type sudo all the time.

And here's my long reply:

I wrote:

Hi Laurence,

Thank you for your reply.  I didn't mean you make you troubleshoot for me smile

I made sure I uncommented what you said I should in the lighttpd.conf
file, and I added this in the end of the file:
****************************
proxy.balance = "fair"
#proxy.server  = ( "/test" =>
#  ( ( "host" => "127.0.0.1", "port" => 8001 ),
#    ( "host" => "127.0.0.1", "port" => 8002 ),
#    ( "host" => "127.0.0.1", "port" => 8003 ) ) )

proxy.server  = ( "/test" =>
       ( ( "host" => "127.0.0.1", "port" => 8001 ) ) )
****************************

My app is called "test".  I tried the first settings (the ones that
are commented out) with this mongrel_cluster.yml file:

****************************
prefix: /test
user: mongrel
cwd: /var/www/rails_apps/test
port: "8000"
environment: production
group: mongrel
address: 127.0.0.1
pid_file: log/mongrel.pid
servers: 3
****************************
... but it didn't work, so I just fiddled around, added the now
uncommented lines in the lighttpd.conf, and tried it with the yml file
below.

****************************
prefix: /test
user: mongrel
cwd: /var/www/rails_apps/test
port: "8000"
environment: production
group: mongrel
address: 127.0.0.1
pid_file: log/mongrel.pid
servers: 1
****************************

I get the same effect on the server with either setting.  I'm able to
access lighttpd, I see the paper airplane.  I'm able to see the rails
index page, but when I click on "About your application's environment"
I get a 404.  When I go try out my say/ controller (which has def
index, which in turn, calls def hello that simply does a render_text),
I get:
****************************

The page you were looking for doesn't exist.

You may have mistyped the address or the page may have moved.
****************************

The weird part is when I do the say/hello, I see the render text on the page!

Anyway, about the error with the find: I run using root all the time
so it shouldn't be a problem yikes  When I run "find /usr/lib/ruby -type
f -name "mongrel_cluster_ctl" -exec sudo ln -s {} /usr/bin; \;", I get
this error:

find: missing argument to `-exec'
-bash: ;: command not found

That's the only visible error when I first tried out your tutorial.  I
supposed that it wouldn't matter since you mentioned that you haven't
found a use for it.

I'm stumped yikes

I started a thread while you were on vacation, but the suggestions I
got don't seem to do the trick.  You may want to visit it here:

http://www.railsforum.com/viewtopic.php?id=2986

Thanks a lot for your time. smile

By the way, I'm just ssh'ing into the server from a windows machine.
I tried this yml configuration too, just in case, but it didn't work:

prefix: /test
user: mongrel
cwd: /var/www/rails_apps/test
port: "8000"
environment: production
group: mongrel
address: rmmt.serveftp.net
pid_file: log/mongrel.pid
servers: 1

Re: 404 / "The page you were looking for doesn't exist."

Laurence replied and I was finally able to fix that problem.. but yup, there are still more sad

The problem was basically my lack of understanding in the area of making lighttpd point to the correct mongrel pids.

Laurence wrote:

Aha, I think I see it:  Your lighttpd.conf is proxying
out to Port 8001, but your mongrel cluster starts at
Port 8000, with a single instance.  Thus, there's
nothing listening on Port 8001.  Odd, though -- I
usually get 503 errors from lighttpd when the mongrel
cluster isn't running.

The only other thing I can think of... is mod_proxy
uncommented at the top of lighttpd.conf?  That could
explain why it's a 404 error instead of a 503 error.

It works now - well at least all the render texts.  I made a model Album which maps to the albums table in the database.  I then made Admin that has a simple scaffold.  When I request for the admin controller in the browser, I get a

Browser wrote:

Routing Error

no route found to match "/music_library/admin" with {:method=>:get}

I don't know what it means.  Currently searching will update you guys if I find out smile

Re: 404 / "The page you were looking for doesn't exist."

Ok, been searching quite a while now, and I haven't been able to gather much info.  It seems like this was a problem when upgrading from an older version of rails - but the thing is, I haven't upgraded and using the latest version yikes

I still haven't figured it out and would appreciate any ideas thrown this way smile