[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

RoR on WinXP/Apache

gander

5/14/2005 2:38:00 AM

I'm trying to get typo up on my local box (WinXP).

When I hit localhost, I get the "Congratulations, you've put Ruby on
Rails!" screen.

When I hit localhost/typo, I get:

-------------------------------
Routing Error

No route for path: "typo"

Failure reasons:

1. <ActionController::Routing::Route ":controller/service.wsdl" when
{:action=>"wsdl"}> failed because no controller found at subpath typo
2. <ActionController::Routing::Route ":controller/:action/:id" ||
{:id=>nil, :action=>"index"}> failed because no controller found at
subpath typo
-------------------------------
I'm a triple newbie: ruby, rails, and apache so I don't even know where
to start.

Here's my take:
1. The request is getting passed from Apache to Rails because the error
is showing "ActionController" stuff.

2. It may be some mis-config in Apache since it can't find the proper
subpath. Here's what I have related to typo in httpd.conf:

<VirtualHost *>
ServerName typo
DocumentRoot /www/webroot/typo/public
<Directory /www/webroot/typo/public/ >
Options ExecCGI FollowSymlinks
AllowOverride all
Allow from all
Order allow,deny
</Directory>
</VirtualHost>

For context, I also have in httpd.conf:

DocumentRoot "C:/www/webroot"

On my hard drive, the path to typo is:

C:\www\webroot\typo


If I serve it up through WEBrick, I get:

--------------------------------------
Routing Error

Illegal controller path for route default: articles
--------------------------------------

This leads me to believe it may also be a problem in config/routes.rb,
which reads, in part:

# default
map.connect '', :controller => 'articles'

Can anyone shed some light and point me in the right direction? I've
really tried to RTFM. Honest.

Thanks,

G

8 Answers

Craig Beck

5/14/2005 4:19:00 AM

0


On May 13, 2005, at 7:40 PM, gander wrote:

> I'm trying to get typo up on my local box (WinXP).
>
> When I hit localhost, I get the "Congratulations, you've put Ruby on
> Rails!" screen.
>
> When I hit localhost/typo, I get:
>
> -------------------------------
> Routing Error
>
> No route for path: "typo"

That sounds correct, as there is no "typo" controller in typo...
however with a regular typo install there shouldn't be any index.html
page (the "Congrats..." page). When you "hit localhost" what exactly
is the url you are using? http://localhost? if so, then you are
seeing the correct directory (typo/public) being served to you...
although I don't know why you'd have the "Congrats you're on Rails"
page.

> Failure reasons:
>
> 1. <ActionController::Routing::Route ":controller/service.wsdl"
> when
> {:action=>"wsdl"}> failed because no controller found at subpath typo
> 2. <ActionController::Routing::Route ":controller/:action/:id" ||
> {:id=>nil, :action=>"index"}> failed because no controller found at
> subpath typo
> -------------------------------
> I'm a triple newbie: ruby, rails, and apache so I don't even know
> where
> to start.
>
> Here's my take:
> 1. The request is getting passed from Apache to Rails because the
> error
> is showing "ActionController" stuff.

Sounds like that's the case

> 2. It may be some mis-config in Apache since it can't find the proper
> subpath. Here's what I have related to typo in httpd.conf:

Sound likely...

> <VirtualHost *>
> ServerName typo
> DocumentRoot /www/webroot/typo/public
> <Directory /www/webroot/typo/public/ >
> Options ExecCGI FollowSymlinks
> AllowOverride all
> Allow from all
> Order allow,deny
> </Directory>
> </VirtualHost>
>
> For context, I also have in httpd.conf:
>
> DocumentRoot "C:/www/webroot"
>
> On my hard drive, the path to typo is:
>
> C:\www\webroot\typo
>
>
> If I serve it up through WEBrick, I get:
>
> --------------------------------------
> Routing Error
>
> Illegal controller path for route default: articles

routes.rb should work just fine as is. I suspect that the
<VirtualHost *> directive you're using is a bit off. I'd get rid of
the ServerName typo to start.

Are you trying to serve it via Apache as a .cgi?

Can you serve typo via Webrick on port 3000 (the default Webrick
port)? i.e. start script/server and goto http://localhost:3000

Is your Rails up to date? how about your gems? I've found that I've
seen errors that didn't make sense because all the bits weren't up to
date.





--
Craig Beck
http://luck...
AIM: Kreiggers




gander

5/15/2005 2:30:00 AM

0

Thanks, Craig. After thinking about your response and a bit of trial
and error, I got Typo up and running.

I appreciate your time.

--George

Curt Hibbs

5/15/2005 5:06:00 AM

0

gander wrote:
> Thanks, Craig. After thinking about your response and a bit of trial
> and error, I got Typo up and running.
>
> I appreciate your time.

Can you post what you did and/or your final configuration files? That
way it will be in the message archives to help the next person who has
the same problem.

Curt


speechexpert

5/15/2005 5:44:00 AM

0

Curt,
In that regard, can you recommend a browser that keeps track of threads or
is at least searchable?
jb
----- Original Message -----
From: "Curt Hibbs" <curt@hibbs.com>
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Sent: Saturday, May 14, 2005 10:05 PM
Subject: Re: RoR on WinXP/Apache


> gander wrote:
> > Thanks, Craig. After thinking about your response and a bit of trial
> > and error, I got Typo up and running.
> >
> > I appreciate your time.
>
> Can you post what you did and/or your final configuration files? That
> way it will be in the message archives to help the next person who has
> the same problem.
>
> Curt
>



gander

5/15/2005 6:16:00 PM

0

At Curt's (excellent) request, here's how I got Typo running on WinXP,
Apache, with Craig's guidance:

Http://localhost ruturned the "Congratulations, you've put Ruby on
Rails!" screen. Except, there was no index.html in my typo/public
directory, so that "Congrats" page was coming from somewhere else.

I had been messing around with the ToDo tutorials, so I suspected it
might be the "Congrats" page from ToDo. So I edited
ToDo/public/index.html and added some markup to identify this
particular "Congrats" page as living in the ToDo/public directory.

Back in the browser, I refreshed http://localhost and, lo, I saw the
ToDo "Congrats" page. At this point I saw it wasn't a Rails issue, but
an Apache issue.

In Apache's httpd.conf, I had this, left over from the ToDo tutorial:

<VirtualHost *>
ServerName todo
DocumentRoot /www/webroot/ToDo/public
<Directory /www/webroot/ToDo/public/ >
Options ExecCGI FollowSymlinks
AllowOverride all
Allow from all
Order allow,deny
</Directory>
</VirtualHost>

So I commented out that block.

Whenever you change httpd.conf, you must restart Apache so the new
config is loaded. So I restarted Apache.

Back in the browser; refresh http://localhost and I get

------------------------------------------
Application error (Apache)
500 Error

Change this error message for exceptions thrown outside of an action
(like in Dispatcher setups or broken Ruby code) in public/500.html
------------------------------------------

I knew the typo/public directory had a 500.html file in it, so I edited
that file and changed "500 Error" to "Typo: 500 Error." Save the
changes.

Refresh http://localhost and I get the 500 error again, but this time I
see "Typo: 500 Error" so I know Apache is serving the right directory.
Now I need to figure out what's causing the 500 error.

I thought really, really hard about it. And for a long time. But that
didn't work. Not at all. So it then dawned on me to read the log
files, which turned out to be much more productive than just thinking.

By luck, I started poking around in the typo/log directory looking for
the most recently modified file.

The file "fastcgi.crash.log" been very recently modified. That fit
with the scenario since 500 errors are "web server errors" which means
something, typically below the level of code you right for your web
site, crashed, choked or blew up. Fastcgi qualifies as something below
the level of my code and the name of the file ("fastcgi.crash.log")
validated the fact that something went amiss with the process.

Opening the log, the first line of the bottom block (the block relevant
to the date/time I was now working) showed:
-------------------------------------------
[Sat May 14 22:04:19 Eastern Daylight Time 2005] Dispatcher failed to
catch: #42000Unknown database 'typo_dev' (Mysql::Error)
-------------------------------------------

Unknown database 'typo_dev'? I was using 'ganderson_typo' for my
database, no wonder it crashed. So now the question: What in my code
said I was using 'typo_dev' as my database (and was ultimately
responsible for crashing fastcgi and producing the 500 error)?

I didn't know the answer to that question, but I knew that
typo/config/database.yaml held info on "my" databases. So I changed
"development," "test," and "production" to:

database: ganderson_typo

I restarted Apache and refreshed http://localhost.

BANG! It worked.

Later I found the settings for which database is used are in
typo/config/environment.rb. I believe when you make changes to this
file, you need to restart Apache because, and I may be completely
wrong, fastcgi causes some of these config options to be cached by
Apache. Changes to such files may not be reflected until the Apache
service is restarted.

One last thing I forgot to mention:

I have this in httpd.conf:

<VirtualHost *>
ServerName typo
DocumentRoot /www/webroot/typo/public
<Directory /www/webroot/typo/public/ >
Options ExecCGI FollowSymlinks
AllowOverride all
Allow from all
Order allow,deny
</Directory>
</VirtualHost>

and I had to remove this line:

ServerName typo

which left me with this:

<VirtualHost *>
DocumentRoot /www/webroot/typo/public
<Directory /www/webroot/typo/public/ >
Options ExecCGI FollowSymlinks
AllowOverride all
Allow from all
Order allow,deny
</Directory>
</VirtualHost>

Craig pointed this out in his original response.

Now everything is being served out of http://localhost.

Can anyone tell me how to serve typo out of http://localhost/typo? I
know it's a change in Apache's httpd.conf, I just don't know what to
change.

Thanks for your help.

--George

Curt Hibbs

5/15/2005 11:44:00 PM

0

pop.sbc.yahoo.com wrote:
> Curt,
> In that regard, can you recommend a browser that keeps track of threads or
> is at least searchable?

Since the ruby-talk ML is mirrored with the comp.lang.ruby newsgroup,
one way to search is to use google groups to search comp.lang.ruby, and
you can do that at this URL:

http://groups-beta.google.com/group/comp.lang....

Curt


Curt Hibbs

5/15/2005 11:46:00 PM

0

Thank you for posting this excellent walk-through. I'm sure that this is
a question that will periodically recur on this list and now we need
only point questioners to this.

Curt

gander wrote:
> At Curt's (excellent) request, here's how I got Typo running on WinXP,
> Apache, with Craig's guidance:
>
> Http://localhost ruturned the "Congratulations, you've put Ruby on
> Rails!" screen. Except, there was no index.html in my typo/public
> directory, so that "Congrats" page was coming from somewhere else.
>
> I had been messing around with the ToDo tutorials, so I suspected it
> might be the "Congrats" page from ToDo. So I edited
> ToDo/public/index.html and added some markup to identify this
> particular "Congrats" page as living in the ToDo/public directory.
>
> Back in the browser, I refreshed http://localhost and, lo, I saw the
> ToDo "Congrats" page. At this point I saw it wasn't a Rails issue, but
> an Apache issue.
>
> In Apache's httpd.conf, I had this, left over from the ToDo tutorial:
>
> <VirtualHost *>
> ServerName todo
> DocumentRoot /www/webroot/ToDo/public
> <Directory /www/webroot/ToDo/public/ >
> Options ExecCGI FollowSymlinks
> AllowOverride all
> Allow from all
> Order allow,deny
> </Directory>
> </VirtualHost>
>
> So I commented out that block.
>
> Whenever you change httpd.conf, you must restart Apache so the new
> config is loaded. So I restarted Apache.
>
> Back in the browser; refresh http://localhost and I get
>
> ------------------------------------------
> Application error (Apache)
> 500 Error
>
> Change this error message for exceptions thrown outside of an action
> (like in Dispatcher setups or broken Ruby code) in public/500.html
> ------------------------------------------
>
> I knew the typo/public directory had a 500.html file in it, so I edited
> that file and changed "500 Error" to "Typo: 500 Error." Save the
> changes.
>
> Refresh http://localhost and I get the 500 error again, but this time I
> see "Typo: 500 Error" so I know Apache is serving the right directory.
> Now I need to figure out what's causing the 500 error.
>
> I thought really, really hard about it. And for a long time. But that
> didn't work. Not at all. So it then dawned on me to read the log
> files, which turned out to be much more productive than just thinking.
>
> By luck, I started poking around in the typo/log directory looking for
> the most recently modified file.
>
> The file "fastcgi.crash.log" been very recently modified. That fit
> with the scenario since 500 errors are "web server errors" which means
> something, typically below the level of code you right for your web
> site, crashed, choked or blew up. Fastcgi qualifies as something below
> the level of my code and the name of the file ("fastcgi.crash.log")
> validated the fact that something went amiss with the process.
>
> Opening the log, the first line of the bottom block (the block relevant
> to the date/time I was now working) showed:
> -------------------------------------------
> [Sat May 14 22:04:19 Eastern Daylight Time 2005] Dispatcher failed to
> catch: #42000Unknown database 'typo_dev' (Mysql::Error)
> -------------------------------------------
>
> Unknown database 'typo_dev'? I was using 'ganderson_typo' for my
> database, no wonder it crashed. So now the question: What in my code
> said I was using 'typo_dev' as my database (and was ultimately
> responsible for crashing fastcgi and producing the 500 error)?
>
> I didn't know the answer to that question, but I knew that
> typo/config/database.yaml held info on "my" databases. So I changed
> "development," "test," and "production" to:
>
> database: ganderson_typo
>
> I restarted Apache and refreshed http://localhost.
>
> BANG! It worked.
>
> Later I found the settings for which database is used are in
> typo/config/environment.rb. I believe when you make changes to this
> file, you need to restart Apache because, and I may be completely
> wrong, fastcgi causes some of these config options to be cached by
> Apache. Changes to such files may not be reflected until the Apache
> service is restarted.
>
> One last thing I forgot to mention:
>
> I have this in httpd.conf:
>
> <VirtualHost *>
> ServerName typo
> DocumentRoot /www/webroot/typo/public
> <Directory /www/webroot/typo/public/ >
> Options ExecCGI FollowSymlinks
> AllowOverride all
> Allow from all
> Order allow,deny
> </Directory>
> </VirtualHost>
>
> and I had to remove this line:
>
> ServerName typo
>
> which left me with this:
>
> <VirtualHost *>
> DocumentRoot /www/webroot/typo/public
> <Directory /www/webroot/typo/public/ >
> Options ExecCGI FollowSymlinks
> AllowOverride all
> Allow from all
> Order allow,deny
> </Directory>
> </VirtualHost>
>
> Craig pointed this out in his original response.
>
> Now everything is being served out of http://localhost.
>
> Can anyone tell me how to serve typo out of http://localhost/typo? I
> know it's a change in Apache's httpd.conf, I just don't know what to
> change.
>
> Thanks for your help.
>
> --George
>
>
>
>



speechexpert

5/16/2005 7:41:00 AM

0

nice, really nice.
thanks curt.
-John B

----- Original Message -----
From: "Curt Hibbs" <curt@hibbs.com>
To: "ruby-talk ML" <ruby-talk@ruby-lang.org>
Sent: Sunday, May 15, 2005 4:43 PM
Subject: Re: RoR on WinXP/Apache


> pop.sbc.yahoo.com wrote:
> > Curt,
> > In that regard, can you recommend a browser that keeps track of threads
or
> > is at least searchable?
>
> Since the ruby-talk ML is mirrored with the comp.lang.ruby newsgroup,
> one way to search is to use google groups to search comp.lang.ruby, and
> you can do that at this URL:
>
> http://groups-beta.google.com/group/comp.lang....
>
> Curt
>