# Debug

**URL:** https://rubytalk.org/t/debug/40587
**Category:** ruby-talk
**Created:** [13 September 2007 08:56 UTC](https://rubytalk.org/t/debug/40587 "2007-09-13T08:56:02Z")
**Posts on this page:** 17
**Page:** 1

<div class="post-metadata">

### Author: ![coolgeng\_coolgeng](https://avatars.discourse-cdn.com/v4/letter/c/eada6e/32.png) [@coolgeng\_coolgeng](https://rubytalk.org/u/coolgeng_coolgeng)
#### Post date: [13 September 2007 08:56 UTC](https://rubytalk.org/t/debug/40587/1 "2007-09-13T08:56:02Z")

</div>

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?

> **···**
>
> --  
> Best Regards  
> Cooper Geng

---

<div class="post-metadata">

### Author: ![Phlip1](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Phlip1](https://rubytalk.org/u/Phlip1)
#### Post date: [13 September 2007 09:42 UTC](https://rubytalk.org/t/debug/40587/2 "2007-09-13T09:42:45Z")

</div>

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:

&nbsp;&nbsp;&nbsp;mysql -u my\_name -pmy\_password my\_database

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

&nbsp;&nbsp;&nbsp;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.

> **···**
>
> --  
> &nbsp;&nbsp;Phlip  
> &nbsp;&nbsp;[Test Driven Ajax (on Rails) [Book]](http://www.oreilly.com/catalog/9780596510657/)  
> &nbsp;&nbsp;"Test Driven Ajax (on Rails)"  
> &nbsp;&nbsp;assert\_xpath, assert\_javascript, & assert\_ajax

---

<div class="post-metadata">

### Author: ![Eugene\_Bolshakov](https://avatars.discourse-cdn.com/v4/letter/e/9fc29f/32.png) [@Eugene\_Bolshakov](https://rubytalk.org/u/Eugene_Bolshakov)
#### Post date: [13 September 2007 09:45 UTC](https://rubytalk.org/t/debug/40587/3 "2007-09-13T09:45:10Z")

</div>

Hi

Did you restart the server?

> **···**
>
> 2007/9/13, coolgeng coolgeng \<coolgeng410@gmail.com\>:
> 
> > 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?
> > 
> > --  
> > Best Regards  
> > Cooper Geng

---

<div class="post-metadata">

### Author: ![coolgeng\_coolgeng](https://avatars.discourse-cdn.com/v4/letter/c/eada6e/32.png) [@coolgeng\_coolgeng](https://rubytalk.org/u/coolgeng_coolgeng)
#### Post date: [17 September 2007 01:59 UTC](https://rubytalk.org/t/debug/40587/4 "2007-09-17T01:59:46Z")

</div>

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

> **···**
>
> On 9/13/07, coolgeng coolgeng \<coolgeng410@gmail.com\> 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?
> > 
> > --  
> > Best Regards  
> > Cooper Geng
> 
> --  
> Best Regards  
> Cooper Geng

---

<div class="post-metadata">

### Author: ![coolgeng\_coolgeng](https://avatars.discourse-cdn.com/v4/letter/c/eada6e/32.png) [@coolgeng\_coolgeng](https://rubytalk.org/u/coolgeng_coolgeng)
#### Post date: [13 September 2007 15:22 UTC](https://rubytalk.org/t/debug/40587/5 "2007-09-13T15:22:57Z")

</div>

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

> **···**
>
> On 9/13/07, Eugene Bolshakov \<eugene.bolshakov@gmail.com\> wrote:
> 
> > Hi
> > 
> > Did you restart the server?
> > 
> > 2007/9/13, coolgeng coolgeng \<coolgeng410@gmail.com\>:  
> > \> 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?  
> > \>  
> > \>  
> > \> --  
> > \> Best Regards  
> > \> Cooper Geng  
> > \>
> 
> --  
> Best Regards  
> Cooper Geng

---

<div class="post-metadata">

### Author: ![coolgeng\_coolgeng](https://avatars.discourse-cdn.com/v4/letter/c/eada6e/32.png) [@coolgeng\_coolgeng](https://rubytalk.org/u/coolgeng_coolgeng)
#### Post date: [17 September 2007 02:14 UTC](https://rubytalk.org/t/debug/40587/6 "2007-09-17T02:14:34Z")

</div>

I check the development.log, and it says : "Mysql::Error: #42S02Table  
'depot\_development.sessions' doesn't exist: SHOW FIELDS FROM sessions"

> **···**
>
> On 9/17/07, coolgeng coolgeng \<coolgeng410@gmail.com\> wrote:
> 
> > 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
> > 
> > On 9/13/07, coolgeng coolgeng \<coolgeng410@gmail.com\> 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?  
> > \>  
> > \>  
> > \> --  
> > \> Best Regards  
> > \> Cooper Geng  
> > \>
> > 
> > --  
> > Best Regards  
> > Cooper Geng
> 
> --  
> Best Regards  
> Cooper Geng

---

<div class="post-metadata">

### Author: ![Phlip1](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Phlip1](https://rubytalk.org/u/Phlip1)
#### Post date: [13 September 2007 22:05 UTC](https://rubytalk.org/t/debug/40587/7 "2007-09-13T22:05:21Z")

</div>

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

Did you try my checklist?

---

<div class="post-metadata">

### Author: ![Phil](https://avatars.discourse-cdn.com/v4/letter/p/e95f7d/32.png) [@Phil](https://rubytalk.org/u/Phil)
#### Post date: [17 September 2007 02:47 UTC](https://rubytalk.org/t/debug/40587/8 "2007-09-17T02:47:18Z")

</div>

Learn what you are actually doing:

> **[Ruby on Rails](https://rubyonrails.org/)**
>
> A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.

And ask the specialists:

> **[Ruby on Rails](https://rubyonrails.org)**
>
> A web-app framework that includes everything needed to create database-backed web applications according to the Model-View-Controller (MVC) pattern.

> **···**
>
> > -----Original Message-----  
> > From: coolgeng coolgeng [mailto:coolgeng410@gmail.com]  
> > Sent: Monday, September 17, 2007 4:15 AM  
> > To: ruby-talk ML  
> > Subject: Re: Debug
> > 
> > I check the development.log, and it says : "Mysql::Error: #42S02Table  
> > 'depot\_development.sessions' doesn't exist: SHOW FIELDS FROM sessions"

---

<div class="post-metadata">

### Author: ![Bambang\_Purnomosidi1](https://avatars.discourse-cdn.com/v4/letter/b/57b2e6/32.png) [@Bambang\_Purnomosidi1](https://rubytalk.org/u/Bambang_Purnomosidi1)
#### Post date: [17 September 2007 03:05 UTC](https://rubytalk.org/t/debug/40587/9 "2007-09-17T03:05:19Z")

</div>

Have a look at config/environment.rb:

&nbsp;&nbsp;&nbsp;...  
&nbsp;&nbsp;&nbsp;# Use the database for sessions instead of the file system  
&nbsp;&nbsp;&nbsp;# (create the session table with 'rake db:sessions:create')  
&nbsp;&nbsp;&nbsp;config.action\_controller.session\_store = :active\_record\_store  
&nbsp;&nbsp;&nbsp;...

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.

> **···**
>
> 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"
> 
> --
> 
> > **[bpdp's logs](https://bpdp.wordpress.com/)**
> >
> > Thoughts on networking, programming, computer science, and everything between
> 
> 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
> 
> --  
> This message has been scanned for viruses and  
> dangerous content by MailScanner, and is  
> believed to be clean.

---

<div class="post-metadata">

### Author: ![coolgeng\_coolgeng](https://avatars.discourse-cdn.com/v4/letter/c/eada6e/32.png) [@coolgeng\_coolgeng](https://rubytalk.org/u/coolgeng_coolgeng)
#### Post date: [14 September 2007 01:58 UTC](https://rubytalk.org/t/debug/40587/10 "2007-09-14T01:58:52Z")

</div>

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](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.

> **···**
>
> On 9/14/07, Phlip \<phlip2005@gmail.com\> wrote:
> 
> > \> Yeah,I have restart the server. But it can not fix it..
> > 
> > Did you try my checklist?
> 
> --  
> Best Regards  
> Cooper Geng

---

<div class="post-metadata">

### Author: ![coolgeng\_coolgeng](https://avatars.discourse-cdn.com/v4/letter/c/eada6e/32.png) [@coolgeng\_coolgeng](https://rubytalk.org/u/coolgeng_coolgeng)
#### Post date: [17 September 2007 03:17 UTC](https://rubytalk.org/t/debug/40587/11 "2007-09-17T03:17:59Z")

</div>

Thanks a lot. When I disabled this line, the program do work.  
But if I would like to reserve this function and not discard this line, what  
should I do?

> **···**
>
> On 9/17/07, Bambang Purnomosidi D. P. \<bpurnomo@akakom.ac.id\> wrote:
> 
> > 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:
> > 
> > &nbsp;&nbsp;&nbsp;...  
> > &nbsp;&nbsp;&nbsp;...  
> > &nbsp;&nbsp;&nbsp;# Use the database for sessions instead of the file system  
> > &nbsp;&nbsp;&nbsp;# (create the session table with 'rake db:sessions:create')  
> > &nbsp;&nbsp;&nbsp;config.action\_controller.session\_store = :active\_record\_store  
> > &nbsp;&nbsp;&nbsp;...  
> > &nbsp;&nbsp;&nbsp;...
> > 
> > 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.
> > 
> > --  
> > [http://bpdp.wordpress.com](http://bpdp.wordpress.com)  
> > 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
> > 
> > --  
> > This message has been scanned for viruses and  
> > dangerous content by MailScanner, and is  
> > believed to be clean.
> 
> --  
> Best Regards  
> Cooper Geng

---

<div class="post-metadata">

### Author: ![Phlip1](https://avatars.discourse-cdn.com/v4/letter/p/df788c/32.png) [@Phlip1](https://rubytalk.org/u/Phlip1)
#### Post date: [14 September 2007 02:57 UTC](https://rubytalk.org/t/debug/40587/12 "2007-09-14T02:57:38Z")

</div>

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.

> =\> Booting Mongrel (use 'script/server webrick' to force WEBrick)  
> =\> Rails application starting on [http://0.0.0.0:3000](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.

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?

> **···**
>
> --  
> &nbsp;&nbsp;Phlip

---

<div class="post-metadata">

### Author: ![James\_Britt](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@James\_Britt](https://rubytalk.org/u/James_Britt)
#### Post date: [17 September 2007 05:35 UTC](https://rubytalk.org/t/debug/40587/13 "2007-09-17T05:35:56Z")

</div>

From this point on it is HIGHLY recommended to buy a book. Especially the Agile Web Development With Rails book.  
It's all in there. (not necessarily in the order you might expect, but it's in there)  
If you're really new to web development, you should go for the Rails book from SitePoint publishing.  
It's a perfect newbie book, but you'll still want to have AWDWR.  
Also, do not neglect the Ruby on Rails web site. There is lots of info there too.  
The Rails Talk group is also helpful, but you'll do better to go there after you've learnt the basics of Rails.  
Don't worry, Rails basics are not that tough. A lot of frameworks in other languages are a LOT more convoluted (sometimes just by the language they're written in)  
Oh one more. keep a browser window open to the Rails API !!! It's quite good and extremely useful in learning and more.

but you really should try to keep questions for this list to Ruby specific things.  
some Rails stuff is Ruby specific, but so far this isn't.

> **···**
>
> On Sep 16, 2007, at 10:17 PM, coolgeng coolgeng wrote:
> 
> > Thanks a lot. When I disabled this line, the program do work.  
> > But if I would like to reserve this function and not discard this line, what  
> > should I do?

---

<div class="post-metadata">

### Author: ![coolgeng\_coolgeng](https://avatars.discourse-cdn.com/v4/letter/c/eada6e/32.png) [@coolgeng\_coolgeng](https://rubytalk.org/u/coolgeng_coolgeng)
#### Post date: [14 September 2007 07:06 UTC](https://rubytalk.org/t/debug/40587/14 "2007-09-14T07:06:51Z")

</div>

My site does not work. And what is the meaning of unit tests pass?There is  
nothing in my log file.

> **···**
>
> On 9/14/07, Phlip \<phlip2005@gmail.com\> wrote:
> 
> > 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.
> > 
> > \> =\> Booting Mongrel (use 'script/server webrick' to force WEBrick)  
> > \> =\> Rails application starting on [http://0.0.0.0:3000](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.
> > 
> > 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?
> > 
> > --  
> > &nbsp;&nbsp;Phlip
> 
> --  
> Best Regards  
> Cooper Geng

---

<div class="post-metadata">

### Author: ![Robert6](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@Robert6](https://rubytalk.org/u/Robert6)
#### Post date: [17 September 2007 06:11 UTC](https://rubytalk.org/t/debug/40587/15 "2007-09-17T06:11:59Z")

</div>

John Joyce wrote:

> > Thanks a lot. When I disabled this line, the program do work.  
> > But if I would like to reserve this function and not discard this line, what  
> > should I do?
> 
> From this point on it is HIGHLY recommended to buy a book. Especially the Agile Web Development With Rails book.  
> It's all in there. (not necessarily in the order you might expect, but it's in there)  
> If you're really new to web development, you should go for the Rails book from SitePoint publishing.  
> It's a perfect newbie book, but you'll still want to have AWDWR.  
> Also, do not neglect the Ruby on Rails web site. There is lots of info there too.  
> The Rails Talk group is also helpful, but you'll do better to go there after you've learnt the basics of Rails.  
> Don't worry, Rails basics are not that tough. A lot of frameworks in other languages are a LOT more convoluted (sometimes just by the language they're written in)  
> Oh one more. keep a browser window open to the Rails API !!! It's quite good and extremely useful in learning and more.
> 
> but you really should try to keep questions for this list to Ruby specific things.  
> some Rails stuff is Ruby specific, but so far this isn't.

Also look at RailsSpace I have both and RailsSpace does a good job of providing information you would have to dig for in the Agile book.

-r

> **···**
>
> > On Sep 16, 2007, at 10:17 PM, coolgeng coolgeng wrote:

---

<div class="post-metadata">

### Author: ![James\_Britt](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@James\_Britt](https://rubytalk.org/u/James_Britt)
#### Post date: [14 September 2007 14:27 UTC](https://rubytalk.org/t/debug/40587/16 "2007-09-14T14:27:36Z")

</div>

on your dev machine, point your web browser to  
localhost:0.0.0.3000  
You should see the Welcome to Rails page.

You also want to make sure you've properly entered the values in your Yaml file for your system.

But you really should take this to the Rails list or browse more Rails sites. This point in starting out with Rails is very well documented in many books and countless online tutorials.

---

<div class="post-metadata">

### Author: ![coolgeng\_coolgeng](https://avatars.discourse-cdn.com/v4/letter/c/eada6e/32.png) [@coolgeng\_coolgeng](https://rubytalk.org/u/coolgeng_coolgeng)
#### Post date: [17 September 2007 01:55 UTC](https://rubytalk.org/t/debug/40587/17 "2007-09-17T01:55:10Z")

</div>

I can see the Welcome to Rails page through "[http://localhost:3000/&quot;\](http://localhost:3000/&quot;%5C).

> **···**
>
> On 9/14/07, John Joyce \<dangerwillrobinsondanger@gmail.com\> wrote:
> 
> > on your dev machine, point your web browser to  
> > localhost:0.0.0.3000  
> > You should see the Welcome to Rails page.
> > 
> > You also want to make sure you've properly entered the values in your  
> > Yaml file for your system.
> > 
> > But you really should take this to the Rails list or browse more  
> > Rails sites. This point in starting out with Rails is very well  
> > documented in many books and countless online tutorials.
> 
> --  
> Best Regards  
> Cooper Geng
