Leopard - Newbie to ROR, help please

Hi guys and gals,

I've upgraded to leopard (clean install) and was under the impression that as ROR comes built into leopard I'd have no problems getting set up.

I've updated it using:

gem update rails

That went fine.

Now I want to install MySQL. I've run:

sudo gem install mysql and I choose the 3rd option (MySQL 2.7 (ruby))

and get the following error:

Building native extensions. This could take a while... ERROR: While executing gem ... (Gem::Installer::ExtensionBuildError)     ERROR: Failed to build gem native extension.

ruby extconf.rb install mysql -- --with-mysql-config=/usr/local/mysql/ bin/mysql_config extconf.rb:1: command not found: /usr/local/mysql/bin/mysql_config -- cflags *** extconf.rb failed *** Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options:   --with-opt-dir   --without-opt-dir   --with-opt-include   --without-opt-include=${opt-dir}/include   --with-opt-lib   --without-opt-lib=${opt-dir}/lib   --with-make-prog   --without-make-prog   --srcdir=.   --curdir   --ruby=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ ruby   --with-mysql-config

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/ mysql-2.7 for inspection. Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.7/gem_make.out

Can anyone help me?

Thanks

Without intending to insult your intelligence, I just want to clarify that you know 'gem install mysql' doesn't install the actual MySQL database, it installs an adaptor to have ruby talk to MySQL, and you don't need to install that for Rails' benefit (only if you wanted to write raw Ruby, without Rails, and have it connect to MySQL).

That said, if you thought you were installing MySQL, you can get that from www.mysql.com/downloads/. If you were in fact trying to install the mysql-ruby adaptor, and you happen to have a PowerPC Mac, then the gem installer will not work. Follow the instructions in this article:

http://www.railsdev.ws/blog/9/compiling-mysql-ruby-for-powerpc/

If I've guessed incorrectly about any of your intents, I appologize.

-- gw

Hi Greg,

Thanks, you've hit it right on the button. I was confused as to whether the gem was actually installing a different version of mysql that was specially adapted to ROR or whether it was - as you say - just installing an adapter. This answers my question. I will wait until MySQL for leopard is released as people are having issues trying to install the tiger package.

Thanks very much

Gareth

Hi Greg,

[...]

I will wait until MySQL for leopard is released as people are having issues trying to install the tiger package.

I don't have Leopard yet (just ordered it), so I can't speak from experience, but you might want to take a look at http://www.luismajano.com/blog/index.cfm/2007/10/30/Getting-MySQL-to-work-with-Leopard-MySQL-on-Leopard .

You should probably be using PostgreSQL anyway. :slight_smile:

Best,

Hi Greg

If I were you I would install Darwin ports. Its similar to package managers on other *nix flavours and it can install MySQL and any dependencies automatically for you.

It is available at Welcome darwinports.com - Justhost.com. Dead easy to install.

Once installed, open up terminal and type

     sudo port install mysql mysql-server

It'll do it for you. Likewise if you ever want to update/install ruby you can do

    sudo port install ruby

and so on. Hope this helps!

Please do NOT use DarwinPorts because that is a fake site that is a
pseudo version. DarwinPorts has been discontinued and moved to
MacPorts. It is hosted by Apple now. http://www.macports.org I have a
good tutorial on my site for installing a solid rails stack via
MacPorts on my blog.

http://www.sysadminschronicles.com

Enjoy. -Ron