# Why is my server shutting down?

**URL:** <https://www.ruby-forum.com/t/why-is-my-server-shutting-down/171803>\
**Category:** Ruby\
**Created:** [July 9, 2009, 2:10pm UTC](https://www.ruby-forum.com/t/why-is-my-server-shutting-down/171803 "2009-07-09T14:10:01Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [July 9, 2009, 2:10pm UTC](https://www.ruby-forum.com/t/why-is-my-server-shutting-down/171803/1 "2009-07-09T14:10:01Z")

</div>

I start the MySQL server with the “ruby script/server” command.  
It loads fine.  
When I go to localhost:3000, the server immediately shuts down and  
throws out an error. It says:  
C:\ruby\lib\ruby\gems\1.8\gems\activerecord-2.3.2\lib\active\_record\connection\_adapters\abstract\_adapter.rb:39:  
[BUG] Segmentation fault ruby 1.8.6 (2008-08-11) [i386-mswin32].  
I’ve been looking around online and many have the same error occuring.  
I’m running mysql 5.0.83, rails 2.3.2, ruby 1.8.6 and rubygems 1.3.4.

Can anybody help!?  
Thanks,  
Jay

---

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [July 9, 2009, 4:25pm UTC](https://www.ruby-forum.com/t/why-is-my-server-shutting-down/171803/2 "2009-07-09T16:25:46Z")

</div>

On Thu, Jul 9, 2009 at 8:10 AM, Jason Cheung[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I start the MySQL server with the “ruby script/server” command.  
> It loads fine.  
> When I go to localhost:3000, the server immediately shuts down and  
> throws out an error. It says:  
> C:\ruby\lib\ruby\gems\1.8\gems\activerecord-2.3.2\lib\active\_record\connection\_adapters\abstract\_adapter.rb:39:  
> [BUG] Segmentation fault ruby 1.8.6 (2008-08-11) [i386-mswin32].  
> I’ve been looking around online and many have the same error occuring.  
> I’m running mysql 5.0.83, rails 2.3.2, ruby 1.8.6 and rubygems 1.3.4.

Can you run ruby -v so we can see the patchlevel?

Certain patchlevels of 1.8.6 have serious issues. Newer ones seem to  
work fine.

-greg

---

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [July 9, 2009, 4:31pm UTC](https://www.ruby-forum.com/t/why-is-my-server-shutting-down/171803/3 "2009-07-09T16:31:05Z")

</div>

> Can you run ruby -v so we can see the patchlevel?
> 
> -greg

patchlevel is 287

---

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [July 9, 2009, 4:42pm UTC](https://www.ruby-forum.com/t/why-is-my-server-shutting-down/171803/4 "2009-07-09T16:42:08Z")

</div>

On Jul 9, 2009, at 7:10 AM, Jason Cheung wrote:

> I start the MySQL server with the “ruby script/server” command.  
> It loads fine.

Actaully, that’s how you are starting you Rails server, most likely.  
Usually a MySQL server is started with a command like mysqld\_safe.

> When I go to localhost:3000, the server immediately shuts down and  
> throws out an error. It says:  
> C:\ruby\lib\ruby\gems\1.8\gems\activerecord-2.3.2\lib\active\_record  
> \connection\_adapters\abstract\_adapter.rb:39:  
> [BUG] Segmentation fault ruby 1.8.6 (2008-08-11) [i386-mswin32].  
> I’ve been looking around online and many have the same error occuring.  
> I’m running mysql 5.0.83, rails 2.3.2, ruby 1.8.6 and rubygems 1.3.4.
> 
> Can anybody help!?

There’s some nasty bug in whatever code Rails needs to load to display  
the homepage of your site. It really shouldn’t be segfaulting, but  
that’s the issue.

The error looks like it is probably related to connecting to your  
database, just because of where it comes from in the code. Here are  
some reality check type questions:

- Do you have a database installed?
- Is that database running?
- Is your config/database.yml file correctly pointed at that database?

Beyond that, you may find better help on the Rails mailing list:

[http://groups.google.com/group/rubyonrails-talk](http://groups.google.com/group/rubyonrails-talk)

James Edward G. II

---

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [July 9, 2009, 7:15pm UTC](https://www.ruby-forum.com/t/why-is-my-server-shutting-down/171803/5 "2009-07-09T19:15:58Z")

</div>

For some reason, however, it appears that Rails is unable to find a  
required MySQL dll. The best fix Iâ€™ve been able to find (ok, I admit  
this is clunky, but anyhow it works) is to copy libmySQL.dll from your  
MySQL binary directory (for example, C:\Program Files\MySQL\MySQL  
Server 5.0\bin) into the Ruby binary directory (for example, C:\ruby  
\bin). Restart your application (shut down and restart the server),  
then try running it again. For me, that fixes the problem.

cheers

---

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [July 9, 2009, 4:35pm UTC](https://www.ruby-forum.com/t/why-is-my-server-shutting-down/171803/6 "2009-07-09T16:35:43Z")

</div>

On Thu, Jul 9, 2009 at 10:31 AM, Jason Cheung[removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > Can you run ruby -v so we can see the patchlevel?
> > 
> > -greg
> 
> patchlevel is 287

Hmm… probably not Ruby then. p287 works-for-me.  
The next place I’d look would be the mysql adapter. Unfortunately,  
it’ll take someone else who’s using MySQL on Windows to help you w.  
that.

-greg

---

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [July 9, 2009, 10:28pm UTC](https://www.ruby-forum.com/t/why-is-my-server-shutting-down/171803/7 "2009-07-09T22:28:14Z")

</div>

In the winows\system32 directory you may find a file called regserver32  
or something like that. Drag the dll onto that and drop and see if that  
fixes it.

* * *

From: Kai KÃ¶nig [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
To: ruby-talk ML [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
Sent: Thursday, July 9, 2009 10:15:07 AM  
Subject: Re: Why is my server shutting down?

For some reason, however, it appears that Rails is unable to find a  
required MySQL dll. The best fix Iâ€™ve been able to find (ok, I admit  
this is clunky, but anyhow it works) is to copy libmySQL.dll from your  
MySQL binary directory (for example, C:\Program Files\MySQL\MySQL Server  
5.0\bin) into the Ruby binary directory (for example, C:\ruby\bin).  
Restart your application (shut down and restart the server), then try  
running it again. For me, that fixes the problem.

cheers

---

<div class="post-metadata">

**Author:** ![inari](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/838e76/32.png) [@inari](https://www.ruby-forum.com/u/inari)\
**Post date:** [July 10, 2009, 5:02pm UTC](https://www.ruby-forum.com/t/why-is-my-server-shutting-down/171803/8 "2009-07-10T17:02:48Z")

</div>

It’s working now. I wish I could shed a bit of light on how it was fixed  
but it literally just started working by itself.
