# Rails Troubles

**URL:** <https://www.ruby-forum.com/t/rails-troubles/94506>\
**Category:** Rails\
**Created:** [January 6, 2006, 7:12am UTC](https://www.ruby-forum.com/t/rails-troubles/94506 "2006-01-06T07:12:48Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![JD\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@JD\_Smith](https://www.ruby-forum.com/u/JD_Smith)\
**Post date:** [January 6, 2006, 7:12am UTC](https://www.ruby-forum.com/t/rails-troubles/94506/1 "2006-01-06T07:12:48Z")

</div>

Greetings:  
I have been attempting to get rails + mysql working for me literally  
all day. I am on a Windows XP SP2 machine using the latest one-click  
installer for ruby and gem for rails.  
What am I missing here? The rails and mysql db do not want to talk  
to each other properly. I tried to do a gem install mysql to get the  
latest mysql and that always crashes because it seems to be looking for  
linux named .so files instead of the .dll’s which are used in windows.  
I have tried this with the 4.1 essential series of mysql and with  
the newly releasd 5.0 essential series. If anyone has any insight as to  
what version of everything I need to use and any extra steps I need to  
take I would greatly appreciate it. I am going to uninstall ruby and  
mysql tomorrow morning and start from scratch - hopefully with an idea  
from you all.

Desperately trying to get things working,

JD Smith

---

<div class="post-metadata">

**Author:** ![JD\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@JD\_Smith](https://www.ruby-forum.com/u/JD_Smith)\
**Post date:** [January 6, 2006, 7:15am UTC](https://www.ruby-forum.com/t/rails-troubles/94506/2 "2006-01-06T07:15:06Z")

</div>

Give InstantRails a shot, it worked like a charm for me on a windows  
box.

[http://instantrails.rubyforge.org/](http://instantrails.rubyforge.org/)

---

<div class="post-metadata">

**Author:** ![JD\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@JD\_Smith](https://www.ruby-forum.com/u/JD_Smith)\
**Post date:** [January 6, 2006, 7:23am UTC](https://www.ruby-forum.com/t/rails-troubles/94506/3 "2006-01-06T07:23:43Z")

</div>

check my post about 4 down from this one “lost mysql connection”

same error, some fixes posted.

---

<div class="post-metadata">

**Author:** ![JD\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@JD\_Smith](https://www.ruby-forum.com/u/JD_Smith)\
**Post date:** [January 6, 2006, 9:55am UTC](https://www.ruby-forum.com/t/rails-troubles/94506/4 "2006-01-06T09:55:42Z")

</div>

How about the configuration.yml  
check it .  
maybe you got a wrong configuration between the RoR  
and Mysql

---

<div class="post-metadata">

**Author:** ![JD\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@JD\_Smith](https://www.ruby-forum.com/u/JD_Smith)\
**Post date:** [January 6, 2006, 5:25pm UTC](https://www.ruby-forum.com/t/rails-troubles/94506/5 "2006-01-06T17:25:01Z")

</div>

joel gump wrote:

> How about the configuration.yml  
> check it .  
> maybe you got a wrong configuration between the RoR  
> and Mysql

It’s not a database.yml problem.

- JD

---

<div class="post-metadata">

**Author:** ![JD\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@JD\_Smith](https://www.ruby-forum.com/u/JD_Smith)\
**Post date:** [January 6, 2006, 5:26pm UTC](https://www.ruby-forum.com/t/rails-troubles/94506/6 "2006-01-06T17:26:07Z")

</div>

Kevin O. wrote:

> Give InstantRails a shot, it worked like a charm for me on a windows  
> box.
> 
> [http://instantrails.rubyforge.org/](http://instantrails.rubyforge.org/)

I could use instantrails, but I don’t want to have to resort to using it  
that way. I should be able to setup mysql and ruby and rails and be  
fine.

- JD

---

<div class="post-metadata">

**Author:** ![JD\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@JD\_Smith](https://www.ruby-forum.com/u/JD_Smith)\
**Post date:** [January 6, 2006, 7:45pm UTC](https://www.ruby-forum.com/t/rails-troubles/94506/7 "2006-01-06T19:45:42Z")

</div>

JD Smith wrote:

> what version of everything I need to use and any extra steps I need to  
> take I would greatly appreciate it. I am going to uninstall ruby and  
> mysql tomorrow morning and start from scratch - hopefully with an idea  
> from you all.
> 
> Desperately trying to get things working,

Two suggestions:

1. Try without the mysql gem - Rails has its own copy of the pure Ruby  
mysql driver, which it will use if no other driver is found.

config\database.yml content like this works for me:

development:  
adapter: mysql  
database: depot\_development  
host: localhost  
username: rails  
password:  
test:  
adapter: mysql  
database: depot\_test  
host: localhost  
username: rails  
password:  
production:  
adapter: mysql  
database: depot\_development  
host: localhost  
username: rails  
password:

(or use root with the appropriate password, if you have set one… I had  
created a rails user with permissions for the depot tables, and no  
password)

1. If you do decide to start from scratch again, try using Instant  
Rails, which bundles everything needed (Ruby, Rails, Apache, and MySQL)

N.B. Don’t run another instance of MySQL at the same time as Instant  
Rails - if you do, you will have to run the Instant Rails instance of  
MySQL on a different socket, rather than the usual 3306, and then you  
will have to configure that everywhere…

Good luck!

Justin

---

<div class="post-metadata">

**Author:** ![JD\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@JD\_Smith](https://www.ruby-forum.com/u/JD_Smith)\
**Post date:** [January 6, 2006, 8:01pm UTC](https://www.ruby-forum.com/t/rails-troubles/94506/8 "2006-01-06T20:01:11Z")

</div>

Aye, I saw that not long ago Joel and it led me to searching for a  
windows version of mysql.so I found it, installed an older 4.1  
essential release and now i’m working. Thanks! 🙂

Cordially,

JD Smith

Joel O. wrote:

> I’ll just copy and paste what I wrote for another thread just like  
> this the other day. your situation is almost identical to mine.
> 
> –
> 
> I wrestled with this problem for a good while.
> 
> couple things I noticed:
> 
> 1 - old versus new passwords [in MySQL] might be an issue. first  
> thing’s first,  
> add a user with the old password format, and a user with the new  
> password format. test with each of those users. one might work. if  
> so then you’re golden. stick with that version of the password hash  
> (old, new, whatever). This wasn’t what fixed my problems though
> 
> 2 - connecting to a db server that was NOT on my local machine worked ok  
> for me.  
> Why? Hell if I know. I just ran another instance of Mysql on a  
> seperate computer, allowed my local machine to connect and voila - it  
> worked.
> 
> 3 - on a lark I checked that I had mysql.so in :  
> C:\ruby\lib\ruby\site\_ruby\1.8\i386-msvcrt  
> and oddly enough. I didn’t. The thought occurred to me to check from  
> some website I ran into … but of course I can’t find right now. If  
> a google search doesn’t turn up anything that works one of us would  
> have no issue sending you one.
> 
> So, yeah, that fixed it for me. Why? I have no idea but it works!
> 
> * * *
> 
> - Joel

---

<div class="post-metadata">

**Author:** ![JD\_Smith](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e95f7d/32.png) [@JD\_Smith](https://www.ruby-forum.com/u/JD_Smith)\
**Post date:** [January 6, 2006, 5:45pm UTC](https://www.ruby-forum.com/t/rails-troubles/94506/9 "2006-01-06T17:45:25Z")

</div>

I’ll just copy and paste what I wrote for another thread just like  
this the other day. your situation is almost identical to mine.

–

I wrestled with this problem for a good while.

couple things I noticed:

1 - old versus new passwords [in MySQL] might be an issue. first  
thing’s first,  
add a user with the old password format, and a user with the new  
password format. test with each of those users. one might work. if  
so then you’re golden. stick with that version of the password hash  
(old, new, whatever). This wasn’t what fixed my problems though

2 - connecting to a db server that was NOT on my local machine worked ok  
for me.  
Why? Hell if I know. I just ran another instance of Mysql on a  
seperate computer, allowed my local machine to connect and voila - it  
worked.

3 - on a lark I checked that I had mysql.so in :  
C:\ruby\lib\ruby\site\_ruby\1.8\i386-msvcrt  
and oddly enough. I didn’t. The thought occurred to me to check from  
some website I ran into … but of course I can’t find right now. If  
a google search doesn’t turn up anything that works one of us would  
have no issue sending you one.

So, yeah, that fixed it for me. Why? I have no idea but it works!

* * *

- Joel
