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.
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
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, 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.
Once you get around to it, note the following: (taken from Riding Rails)
"The only minor snag is that in order to install the MySQL C bindings
for Ruby, you have to be quite particular on the command line. Here’s
the cheat line you need to install (read more at macosforge):
sudo env ARCHFLAGS=“-arch i386” gem install mysql –
–with-mysql-config=/usr/local/mysql/bin/mysql_config"
Now I want to install MySQL. I’ve run:
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.
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:
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.
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.