Db connection problem: Mac X, MySQL 5, Rails 1

This has taken me quite a bit of time to sort out. The problem is this:

Whenever my Rails app tries to query the db, it hangs forever.

Having searched 5000+ emails to this group, I’ve not found an answer to
my
problem. I’d be happy to turn on logging, but can’t seem to get the Mac
install of MySQL to boot up with the --log option set. I tried running
mysqld and mysql_safe manually, but encountered a frustrating lock.pid
file
problem.

There are no error messages printed to the screen, nor are there any
messages in the WebRick monitor. (Oh yeah… I’m using WebRick). I
tested
Rails without a db-hit, and it worked fine.

Anyone got any ideas?

Doug,

Did you ever resolve this problem? I’m having what sounds to be the
same problem.

I’ve followed this installation guide:

and when I attempted to follow this tutorial:

I encounter the same problem you describe the first time I try to
connect to a database.

I’m using OS X 10.4.4, mysql 4.1.15, Ruby 1.8.2 (even though the above
setup tutorial apparently had me install 1.8.4, rails_info/properties
says it’s 1.8.2), Rails 1, RubyGems 0.8.10.

If Doug, or anyone else has any suggestions for resolving this, it would
be greatly appreciated, as it’s a very frustrating problem!

Thanks,

Graeme

Doug Hernandez wrote:

This has taken me quite a bit of time to sort out. The problem is this:

Whenever my Rails app tries to query the db, it hangs forever.

Having searched 5000+ emails to this group, I’ve not found an answer to
my
problem. I’d be happy to turn on logging, but can’t seem to get the Mac
install of MySQL to boot up with the --log option set. I tried running
mysqld and mysql_safe manually, but encountered a frustrating lock.pid
file
problem.

There are no error messages printed to the screen, nor are there any
messages in the WebRick monitor. (Oh yeah… I’m using WebRick). I
tested
Rails without a db-hit, and it worked fine.

Anyone got any ideas?

I had (3-4 months ago) what sounds like a similar problem (I’m running
OS X 10.4). I had to actually build the mysql connector on my box for
it to work properly. I don’t have any references for you but you should
be able to find something on Google. That’s where I looked.

Worked first time, exactly as you described!

Thanks very much, you’ve saved me from a weekends worth of hair pulling.

Cheers,

Graeme

Hold it! I did find this. You need XCode installed to do this:

Download and unpack this:

http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.tar.gz

cd to the unpacked directory and do this:

sudo gcc_select 4.0

export PATH=/usr/local/mysql/bin:$PATH

ruby extconf.rb --with-mysql-config

make

sudo make install

Rick, et al. I stumbled across this thread when looking for info on this
error:

/usr/lib/ruby/gems/1.8/gems/activerecord-1.13.2/lib/active_record/vendor/mysql.rb:1079:
[BUG] Bus Error

My server (WEBrick) would hang on anything other than localhost:3000,
but the description of your problem may be what’s happening. I began the
process you’ve outlined, but then get an error:

can’t find header files for ruby.

when attempting to run:

ruby extconf.rb --with-mysql-config

Any thoughts as to what might be happening?

I’ve set up my rails config following the hivelogic
tutorial
, and had mysql access issues for a while initially.

Rick Williams wrote:

Hold it! I did find this. You need XCode installed to do this:

Download and unpack this:

http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.tar.gz

cd to the unpacked directory and do this:

sudo gcc_select 4.0

export PATH=/usr/local/mysql/bin:$PATH

ruby extconf.rb --with-mysql-config

make

sudo make install