简体   繁体   中英

Rails Server hangs, Rake db.migrate hangs, appears to be hanging on DB server connection, but I can connect to DB server without a problem

I'm switching a project from Rails2 to Rails3. I run:

rails server

The server starts up without errors:

=> Booting WEBrick
=> Rails 3.0.7 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
loaded openid

When I connect to localhost:3000, the server registers a \GET request in the log, but never responds. The HTTP just hangs open. Inspecting the process shows that it is connecting to the localhost DB switching ports every 2 seconds.

  • Development.log shows "Started GET "/" for 127.0.0.1 at Mon Jun 06 12:44:08 -0400 2011" but nothing else.

  • Same issue occurs if I attempt to run any rake task.

  • Other people in my office are running the same code in rails3 without problems (I tried it with a fresh git clone).

  • I can connect to the localhost DB without any problems.

  • Problem did not occur when running rails2.

Any ideas about where my problem is? How I can debug (secret log files, places to sneak in a debugger to see what is going on, etc..)?

EDIT: Problem magically went away, how odd.

You say the app hangs. When you kill it, it should show a backtrace of where it was just before. This should give you a clue where to look for the problem.

A further investigation of this issue determined that the database.yml was incorrectly configured (the wrong ip address was being specified for local host).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM