Rails Troubles

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

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

http://instantrails.rubyforge.org/

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

same error, some fixes posted.

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

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

Kevin O. wrote:

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

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

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)

    http://instantrails.rubyforge.org/wiki/wiki.pl

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

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! :slight_smile:

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

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