January 23, 2006

ruby on rails and mysql.

so i'm playing around with ruby on rails. on my powerbook running tiger. i got rails running, easy. i get the "welcome to ruby on rails." sweet.

then i try to install mysql. not so straightforward.

i downloaded the mysql5.0 distribution from www.mysql.com. but then when i go to terminal and type "mysql" or "mysql -v" or something, i get this:

-bash: mysql: command not found

that would have worked if i was installing with window, i think. blah.

anyway, i found tony arnold's instructions, and while he didn't explain why or how, they work. i'm blogging this more so i can remember what i did than for you, america.

basically, i hadn't installed the mysql bindings. and that made everything all pissy.

1. go to www.mysql.com. get latest stable version of mysql. (for me, it was 5.0.18-standard for powerpc)
2. unzip/untar and run the installer
3. Un-install any MySQL rubygems you may already have installed. We need to remove any earlier - possibly failed - attempts at installing the binding:

sudo gem uninstall mysql

3. Download and installing the latest MySQL bindings. I got them from http://tmtm.org/downloads/mysql/ruby/mysql-ruby-2.7.tar.gz,
unzip/untar, then go to terminal and navigate to the unzipped folder.

~mysql-ruby-2.7> sudo gcc_select 4.0
~mysql-ruby-2.7> export PATH=/usr/local/mysql/bin:$PATH
~mysql-ruby-2.7> ruby extconf.rb --with-mysql-config

then it says:
checking for mysql_ssl_set()... yes
checking for mysql.h... yes
creating Makefile

then i'm like:


~mysql-ruby-2.7> make

then he's all:

gcc -fno-common -arch ppc -g -Os -pipe -fno-common -arch ppc -pipe -pipe -fno-common -I. -I/usr/lib/ruby/1.8/powerpc-darwin8.0 -I/usr/lib/ruby/1.8/powerpc-darwin8.0 -I. -DHAVE_MYSQL_SSL_SET -DHAVE_MYSQL_H -I/usr/local/mysql/include -Os -arch ppc -c mysql.c
cc -dynamic -bundle -undefined suppress -flat_namespace -L"/usr/lib" -o mysql.bundle mysql.o -L/usr/local/mysql/lib -lmysqlclient -lz -lm -lpthread -ldl -lobjc

then i say:


~mysql-ruby-2.7> sudo make install

then he said:
install -c -p -m 0755 mysql.bundle /usr/lib/ruby/site_ruby/1.8/powerpc-darwin8.0


and i'm done. then, i can say "mysql" in terminal and it works.
for now.

Posted by ericlau at 08:20 PM | Comments (2)

January 11, 2006

stats are lame

judging from the chairmanlau's year end contest, you all hate me. that's ok. i don't like you either.

i also found out that my fancy AWStats stuff that i set up a while back broke. on Dec 25th, it stopped working. merry xmas to me! what was wrong? who knows. is it fixed? not yet.

but i updated the stuff by following directions from here:

$ mkdir templog
$ perl awstats/tools/logresolvemerge.pl logs/access.log.*.gz > templog/temp.log
$ perl awstats/cgi-bin/awstats.pl -config=yourself -LogFile=$HOME/templog/temp.log -update
$ rm -rf templog

so it's up to date. still broken. but whatever. blah!

Posted by ericlau at 01:11 PM | Comments (1)