Setting up rails environment on Leopard

Hi there!

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

Am I missing a installation step?

Thanks!

On 6 Nov 2007, at 17:39, jy_nl wrote:

Ruby version 1.8.6 (universal-darwin9.0)

Am I missing a installation step?

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.

Fred

Thanks all, got it working now.

Or you can update to rails 1.2.5. This version defaults to mysql.

2007/11/6, Frederick C. [email protected]:

fix to actually start MySQL on Leopard (because this was also a
Active Support version 1.4.2
Fred


Best Regards/Med Venlig Hilsen

Frank Vilhelmsen
Seniorkonsulent
Cyber Com Consulting A/S
mobil: +45 29483809
[email protected]
www.cybercomgroup.com/dk

www.frankvilhelmsen.com

Hmm, seems not to work actually. When I now want to create databases,
as the book suggest, the system can’t find the command:

$ mysql5 -u root

should be mysql -u root, not mysql5

jy_nl wrote:


Sincerely,

William P.

Working on Mac OS X so the book says mysql5 (but also mysql doesn’t
work)

Thanks all, got it working now.

try this.

$ mysql -u root
use mysql;
mysql> UPDATE user SET Password=PASSWORD(“secret”);
mysql> flush privileges;

$ mysql -u root -p

mysql> create database foo_dev;

mysql> grant all on foo_dev.* to ‘foo’@’%’ identified by ‘foo’;
mysql> flush privileges;

$ mysql -u foo -p

/Frank

2007/11/6, jy_nl [email protected]:

That won’t work, mysql is not in his path.

-Bill

Frank Vilhelmsen wrote:

work)

as the book suggest, the system can’t find the command:
William P.


Sincerely,

William P.

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.

-Bill

jy_nl wrote:

Sincerely,

William P.


Sincerely,

William P.

@Frank: $ mysql -u root doesn’t work, so I’m not coming any further :frowning:

@William: when I just installed as usually, where is my MySQL path.

Found something out: when I use the MySQL GUI I can create databases
and do things with it. So it is probably what William is saying.

On 6 nov, 22:14, “Frank Vilhelmsen” [email protected]

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.

Let me know if you need more help.

-Bill

jy_nl wrote:

try this.
mysql> grant all on foo_dev.* to ‘foo’@’%’ identified by ‘foo’;

as the book suggest, the system can’t find the command:
William P.


Sincerely,

William P.

my .profile file ,

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

I think that this is the default path to mysql.

2007/11/6, William P. [email protected]:

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.

Ahh, there you go, thats probably it. I compiled mine from source, so I
wasn’t sure.

-Bill

Frank Vilhelmsen wrote:

binary will be the same, so for example if that command returns
-Bill
On 6 nov, 22:14, “Frank Vilhelmsen” [email protected]
$ mysql -u root -p
2007/11/6, jy_nl [email protected]:

William P.


Sincerely,

William P.

Yes, it is working now! Thanks for your help.

If you can find /usr/local/mysql then the command to run should be:

/usr/loca/mysql/bin/mysql -u root

-Bill

jy_nl wrote:

will get a ton of results so using the first command will be much cleaner.

wrote:

mysql> create database foo_dev;

Working on Mac OS X so the book says mysql5 (but also mysql doesn’t


Sincerely,

William P.


Sincerely,

William P.