Forum: Ruby on Rails db connection problem: Mac X, MySQL 5, Rails 1

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
254b5c76ae14e5a471c1501495f821e3?d=identicon&s=25 Doug Hernandez (Guest)
on 2006-01-01 17:48
(Received via mailing list)
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?
98bda26600c6e6d67363d0eea2b9020b?d=identicon&s=25 Graeme Shaw (Guest)
on 2006-01-22 11:58
Doug,

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

I've followed this installation guide:
http://hivelogic.com/articles/2005/12/01/ruby_rail...

and when I attempted to follow this tutorial:
http://www.onlamp.com/pub/a/onlamp/2005/01/20/rails.html

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?
01ec89b682c7ae076d25c39a70def227?d=identicon&s=25 Rick Williams (rick)
on 2006-01-23 16:48
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.
01ec89b682c7ae076d25c39a70def227?d=identicon&s=25 Rick Williams (rick)
on 2006-01-23 16:59
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
98bda26600c6e6d67363d0eea2b9020b?d=identicon&s=25 Graeme Shaw (Guest)
on 2006-01-23 19:42
Worked first time, exactly as you described!

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

Cheers,

Graeme
2cc220b7200865c3d9737b17f3140fe5?d=identicon&s=25 Rob (Guest)
on 2006-01-28 15:46
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 <a
href="http://hivelogic.com/articles/2005/12/01/ruby_rail...
tutorial</a>, 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
This topic is locked and can not be replied to.