[lnkForumImage]
TotalShareware - Download Free Software

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


 

Forums >

comp.lang.ruby

Problem running Rails sample app from O'Reilly

Chris

4/4/2005 7:35:00 PM

On the "Getting Started With Rails" page on
"http://www.rubyonrails..., I noticed the nice article written this
year by O'Reilly and thought I would give the sample application in the
article a spin. The article and URL is:

Rolling With Rails:
http://www.onlamp.com/pub/a/onlamp/2005/01/20/...

I've followed the directions to a "tee" and the really simple
controller called "MyTest" in the article works fine. This let me know
that my installation of Rails was probably ok. But when I went to
implement the Recipe application, I got an error page when I attempted
to run:

http://localhost:3000/recipe/new

I wish I had the application and Rails running on an external server
where this could be viewed, but I don't right now. I took a snapshot
of the error and posted it here:

http://members.cox.net/perljunkie/rails-reci...

When I try to click the "Retry with Breakpoint" button, the browser
just sits and spins. This is obviously using the builtin WEBrick
server which I've had to restart multiple times. Nothing really seems
to work.

I'm going to attempt to get Rails running under Apache as my next step.
But meanwhile, I was wondering it someone might have an idea from
looking at the O'Reilly article and the error snapshot what the problem
might be.

Incidentally, I tried this on both Windows (under Cygwin) and Linux and
got the exact same error. NO IDEA how to trouble-shoot this right now
since I'm a Ruby Nuby.

-ceo

3 Answers

Chris Wanstrath

4/5/2005 3:20:00 AM

0

On Apr 4, 2005 3:40 PM, Chris <newsbot@cox.net> wrote:
> I wish I had the application and Rails running on an external server
> where this could be viewed, but I don't right now. I took a snapshot
> of the error and posted it here:
>
> http://members.cox.net/perljunkie/rails-reci...

I'm not a Windows guy, but in *nix that message usually means your
MySQL server isn't running. It's looking for the file
'/tmp/mysql.sock' to find out how to access the server. So either
your MySQL server isn't running, or you need to somehow tell Rails
that you're on Windows (maybe that's in that LAMP article?). Sorry I
can't be of more help, but it's a start.

--
Chris Wanstrath
cwanstrath@gmail.com


james_b

4/5/2005 3:33:00 AM

0

Chris Wanstrath wrote:
>
> I'm not a Windows guy, but in *nix that message usually means your
> MySQL server isn't running. It's looking for the file
> '/tmp/mysql.sock' to find out how to access the server. So either
> your MySQL server isn't running, or you need to somehow tell Rails
> that you're on Windows (maybe that's in that LAMP article?). Sorry I
> can't be of more help, but it's a start.

You may want to ask this on the Rails list, but offhand it may be that
Windows Mysql isn't putting that file where code expects it.

James


Chris

4/5/2005 5:27:00 AM

0

Well, I lied a little bit. "Followed the directions to a 'tee'" wasn't
exactly correct. Since I didn't have MySQL installed on the Windows
box, I was attempting to port forward port 3306 back home to my MySQL
installation there. Turns out that in Rails, if you specify
"localhost" the MySQL Activator looks to see if one is running under
Unix and if so, it attempts to connect to /tmp/mysql.sock even if a
port is specified in database.yaml. Since I was attempting to run
under Cygwin, it looked like Unix to Rails, so... that's what it did
and there is no way to get it to look at the port number in
database.yaml.

When I installed Rails completely under Windows (and not under Cygwin),
the port forwarding worked.

I found the code in Rails that makes the MySQL connect and a simple
change would allow someone to run Rails with a MySQL Activator using a
port forwarded connection to a backend MySQL box. I submitted my patch
to the author of the MySQL Activator, so we'll see what happens.

-ceo