I was just setting up my rails environment in Leopard, with help of
the Sitepoint ROR book. However, I've a problem with the MySQL
installation. The installation of MySQL itself went okay, and I did a
fix to actually start MySQL on Leopard (because this was also a
problem). Now, running MySQL, I get in my Rails application welcome
screen that the database adapter is sqlite?
Ruby version 1.8.6 (universal-darwin9.0)
RubyGems version 0.9.4
Rails version 1.2.3
Active Record version 1.15.3
Action Pack version 1.13.3
Action Web Service version 1.2.3
Action Mailer version 1.3.3
Active Support version 1.4.2
Application root /Users/shovell
Environment development
Database adapter sqlite3
rails on leopard defaults to sqlite (reasonably enough - leopard ships with sqlite but not mysql). You need to edit your database.yml or pass --database=mysql to the rails command when you generate the app.
I use osx as well. Maybe they have started creating a symlink called
mysql5, but not to my knowledge. I assume the problem is that mysql is
not in your path. You probably need to fully qualify the path to it. I
am not sure where or how you installed it so I can’t help you with the
path, but try “locate mysql” and that will get you pointed in the right
direction.
William where can I find the path of MySQL when I installed just the
normal version without changing the path? I found out that I can
create databases using the MySQL GUI.
Open a terminal and type “locate mysql_upgrade”. The path to the mysql
binary will be the same, so for example if that command returns
/usr/local/mysql/bin/mysql_upgrade, then mysql is in
/usr/local/mysql/bin/mysql. You can just type “locate mysql”, but you
will get a ton of results so using the first command will be much
cleaner.
If you just installed mysql today, the locate database may not have
updated yet. In that case, type “/usr/libexec/locate.updatedb”. Once
that finishes, run the locate command again from above.
Hmm, weird he can't find mysql_upgrade, even if I update the locate
database. Also tried the the folder /usr/local/mysql/bin, but there he
cannot find another folder mysql and the query doesn't work.