I have installed mysql v2.8.1 with ruby v 1.9.3p125.
When I try and connect to a mysql database with:
m = Mysql.new('localhost','root','','dbname')
I get the following error message:
in `initialize': wrong number of arguments(4 for 0) (ArgumentError)
I have tested that mysql is installed by checking gem list and also by issuing the command require ‘mysql’ from the irb prompt which shows “true”.
I have also uninstalled and installed mysql a number of times and tried to install using the instructions shown here: http://thinlight.org/2010/05/12/how-to-install-ruby-mysql-on-mac-os-x-10-6-snow-leopard/
Does anyone have any other suggestions to try?
I found the solution. I added ‘export DYLD_LIBRARY_PATH=”/usr/local/mysql/lib:$DYLD_LIBRARY_PATH”‘ to my .bash_profile and it worked. – pdoak Jun 12 at 16:49