Debug

With the Rails, I build a project connecting the MySQL. But When I
change
the password access in database. I can not access in the project. Then I
check the database.yml file. And change the username and password. But
it
does not work.
So …
I do not know how to resolve this problem?

coolgeng coolgeng wrote:

With the Rails, I build a project connecting the MySQL. But When I change
the password access in database. I can not access in the project. Then I
check the database.yml file. And change the username and password. But it
does not work.
So …
I do not know how to resolve this problem?

Can’t see your code, so here’s some generic tips:

Log into mysql the same way Rails would:

mysql -u my_name -pmy_password my_database

Next, if MySQL is on the same ‘localhost’ as your site, log in as root:

mysql -u root my_database

If that works, just use root, with no password, in the YML file.

Next, write unit tests, and direct them to another database in the same
server. Unit tests are how Rails projects “debug” their features.

Next, read the files in your log/ folder to see if any error messages
arrived there.

Hi

Did you restart the server?

2007/9/13, coolgeng coolgeng [email protected]:

Yeah,I have restart the server. But it can not fix it…

Yeah,I have restart the server. But it can not fix it…

Did you try my checklist?

I can access the database following the “mysql -u root my_database” .
But
there is still some problem.

F:\work\depot>ruby script/server
./script/…/config/boot.rb:43:Warning: require_gem is obsolete. Use gem
instead
.
=> Booting Mongrel (use ‘script/server webrick’ to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Ruby version is not up-to-date; loading cgi_multipart_eof_fix
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment…
** Rails loaded.
** Loading any Rails specific GemPlugins
** Signals ready. INT => stop (no restart).
** Mongrel available at 0.0.0.0:3000
** Use CTRL-C to stop.

coolgeng coolgeng wrote:

./script/…/config/boot.rb:43:Warning: require_gem is obsolete. Use gem
instead

That will say that for a few more versions of Rails, apparently. It is a
“warning”, which in computer science is a minor error that does not stop
a
program.

** Mongrel available at 0.0.0.0:3000
** Use CTRL-C to stop.

And that is a normal Mongrel startup.

Does your site work? Do your unit tests pass? What is in your log/*
folder?
Does log/development.log contain the word Error anywhere?

I check the development.log, and it says : “Mysql::Error: #42S02Table
‘depot_development.sessions’ doesn’t exist: SHOW FIELDS FROM sessions”

On Mon, 17 Sep 2007, coolgeng coolgeng wrote:

I check the development.log, and it says : “Mysql::Error: #42S02Table
‘depot_development.sessions’ doesn’t exist: SHOW FIELDS FROM sessions”

Have a look at config/environment.rb:


Use the database for sessions instead of the file system

(create the session table with ‘rake db:sessions:create’)

config.action_controller.session_store = :active_record_store

If you activate config.action_controller.session_store above, you should
do ‘rake db:sessions:create’ first. If you don’t want to use MySQL table
to store session, uncomment above.

Key fingerprint FBBA CDA6 1A33 D41C 2470 5B82 12D9 DB12 84C7 32CE
Key server ldap://pgp.surfnet.nl:11370 & hkp://subkeys.pgp.net
ID 0x84C732CE

When I redirect to the Welcome to Rails page, I click the “About your
application’s enviroment”
It shows:

Status: 500 Internal Server Error Content-Type: text/html Application
error
(Apache)

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