mysql gem

Hi. I'm new on Ruby on Rails, on a Mac OS X 10.5. I'm working with Aptana and I've got an message error telling me to install mysql via gem. But when I'm doing gem install mysql, i've got this message :

Hi. I'm new on Ruby on Rails, on a Mac OS X 10.5. I'm working with Aptana and I've got an message error telling me to install mysql via gem. But when I'm doing gem install mysql, i've got this message :

Where have you installed mysql? What gem command did you run ?

Fred

Find and locate mysql_config on your machine and do a

gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/ msql_config

or whichever directory contains your Mysql install. I personally find the config file option to be more reliable during gem install rather than just using the mysql-dir.

Mukund wrote:

Find and locate mysql_config on your machine and do a

Well, no mysql_config at all...

Mukund wrote:

Find and locate mysql_config on your machine and do a

Sorry, in fact I found it and now, I got this :

Mukund wrote:

Find and locate mysql_config on your machine and do a

Well, no mysql_config at all...

Where did you get mysql from? On my mac mysql is installed in /usr/ local/mysql (and mysql_config is in /usr/local/mysql/bin)

Fred

Frederick Cheung wrote:

You may have to give gem a hint as to your architecture:

ARCHFLAGS="-arch i386" sudo gem install mysql -- --with-mysql-config=/ Applications/MAMP/Library/bin/mysql_config

or

ARCHFLAGS="-arch ppc" sudo gem install mysql -- --with-mysql-config=/ Applications/MAMP/Library/bin/mysql_config

-Christopher Haupt -LearningRails.com

Chris Haupt wrote:

You may have to give gem a hint as to your architecture:

ARCHFLAGS="-arch i386" sudo gem install mysql -- --with-mysql-config=/ Applications/MAMP/Library/bin/mysql_config

Well, the answer is now :

ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/ Select which gem to install for your platform (universal-darwin8.0) 1. mysql 2.7.3 (mswin32) 2. mysql 2.7.1 (mswin32) 3. mysql 2.7 (ruby) 4. mysql 2.6 (ruby) 5. Skip this gem 6. Cancel installation

3

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=/ extconf.rb:1: command not found: / --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=/usr/local/bin/ruby   --with-mysql-config

Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection. Results logged to /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out

Chris Haupt wrote: > You may have to give gem a hint as to your architecture:

> ARCHFLAGS="-arch i386" sudo gem install mysql -- --with-mysql-config=/ > Applications/MAMP/Library/bin/mysql_config

It looks like it got confused by a extra line ending in between the -- with-mysql-config=/ and the Applications...

Fred

Frederick Cheung wrote:

It looks like it got confused by a extra line ending in between the -- with-mysql-config=/ and the Applications...

Fred

Well.... I'm gonna become crazy... :

sh-3.2# ARCHFLAGS="-arch i386" gem install mysql -- --with-mysql-config=/Applications/MAMP/Library/bin/mysql_config Select which gem to install for your platform (universal-darwin8.0) 1. mysql 2.7.3 (mswin32) 2. mysql 2.7.1 (mswin32) 3. mysql 2.7 (ruby) 4. mysql 2.6 (ruby) 5. Skip this gem 6. Cancel installation

3

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=/Applications/MAMP/Library/bin/mysql_config checking for mysql_ssl_set()... no checking for mysql.h... no checking for mysql/mysql.h... no *** 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=/usr/local/bin/ruby   --with-mysql-config

Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7 for inspection. Results logged to /usr/local/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out