# Action Controller: Exception caught

**URL:** <https://www.ruby-forum.com/t/action-controller-exception-caught/116557>\
**Category:** Rails\
**Created:** [October 7, 2007, 9:05am UTC](https://www.ruby-forum.com/t/action-controller-exception-caught/116557 "2007-10-07T09:05:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![xwordguy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/65b543/32.png) [@xwordguy](https://www.ruby-forum.com/u/xwordguy)\
**Post date:** [October 7, 2007, 9:05am UTC](https://www.ruby-forum.com/t/action-controller-exception-caught/116557/1 "2007-10-07T09:05:13Z")

</div>

I seem to be having a problem getting my RoR all setup with MySQL  
database.  
I am developing on Windows XP. Installed MySQL 5.0 and it seems to be  
working and have already fixed an issue with my password in the  
database.yml file.

I have tried creating a controller like this:  
class BlogController \< ApplicationController  
scaffold :post  
end

and a model like this:  
class Post \< ActiveRecord::Base  
end

and have created the database in MySQL and created a table like so:  
drop table if exists posts;  
create table posts (  
id int not null auto\_increment primary key,  
title varchar(255) not null,  
created\_at datetime,  
body text  
);

Then when I go to localhost:3000 after starting my mongrel server I get  
this page:  
Errno::EBADF in BlogController#index

Bad file descriptor - connect(2)

RAILS\_ROOT: C:/dev/blog/config/…

I can post the full trace if it will help. Anyone have any ideas what I  
am doing wrong? I basically am just trying to see some scaffolding.  
Thank you so much.

---

<div class="post-metadata">

**Author:** ![xwordguy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/65b543/32.png) [@xwordguy](https://www.ruby-forum.com/u/xwordguy)\
**Post date:** [October 7, 2007, 5:50pm UTC](https://www.ruby-forum.com/t/action-controller-exception-caught/116557/2 "2007-10-07T17:50:12Z")

</div>

The Bad File Descriptor error typically means an IP port is already in  
use by another app. Open a command window and run ‘netstat -a’ for a  
list of the apps / ports in use.

On common situation we’ve seen in the past is where folks have installed  
MySQL seperately, then downloaded and installed Instant Rails which  
comes packaged with its own copy of MySQL. If that’s your situation, you  
just need to shut down the other copy before starting Instant Rails.

If that’s not it, the netstat utility will tell you where the problem is  
and you’ll just need to start WeBrick and / or MySQL on ports not  
already in use. BTW, a lot of us have switched to using Mongrel over  
WeBrick (\> mongrel\_rails start). It’s also packaged with both Instant  
Rails and Rails.
