From: Andrew Ting on
Hi,

I downloaded & double clicked 3 files to install mysql 5.1 for MacOS,
but i get the following errors, can someone advise please?

Thanks!

Ad

======================================================

sudo gem install mysql -- --with-mysql-config=/path/to/mysql_config
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb --with-mysql-config=/path/to/mysql_config
extconf.rb:10: command not found: /path/to/mysql_config --cflags
Gem files will remain installed in
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to
/Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out


And when i ran one ruby program :-


$ ruby blog.rb
/Library/Ruby/Gems/1.8/gems/sequel-3.7.0/lib/sequel/adapters/mysql.rb:2:
LoadError: require 'mysql' did not define Mysql::CLIENT_MULTI_RESULTS!
(Sequel::AdapterNotFound)
You are probably using the pure ruby mysql.rb driver,
which Sequel does not support. You need to install
the C based adapter, and make sure that the mysql.so
file is loaded instead of the mysql.rb file.
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from
/Library/Ruby/Gems/1.8/gems/sequel-3.7.0/lib/sequel/core.rb:165:in
`require'
from
/Library/Ruby/Gems/1.8/gems/sequel-3.7.0/lib/sequel/core.rb:165:in
`each'
from
/Library/Ruby/Gems/1.8/gems/sequel-3.7.0/lib/sequel/core.rb:165:in
`require'
from
/Library/Ruby/Gems/1.8/gems/sequel-3.7.0/lib/sequel/database.rb:111:in
`adapter_class'
from
/Library/Ruby/Gems/1.8/gems/sequel-3.7.0/lib/sequel/database.rb:140:in
`connect'
from
/Library/Ruby/Gems/1.8/gems/sequel-3.7.0/lib/sequel/core.rb:100:in
`connect'
from ./data/init.rb:7
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
from /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
from blog.rb:7
--
Posted via http://www.ruby-forum.com/.

From: Phillip Gawlowski on
On 21.12.2009 15:24, Andrew Ting wrote:
> Hi,
>
> I downloaded& double clicked 3 files to install mysql 5.1 for MacOS,
> but i get the following errors, can someone advise please?
>
> Thanks!
>
> Ad
>
> ======================================================
>
> sudo gem install mysql -- --with-mysql-config=/path/to/mysql_config

Is that verbatim? If so, you need to replace /path/to/mysql_config with
the actual path to your mysql_config file (dunno whcih one is meant,
maybe my.cnf?).

Finder could help you, once you know which sort of config file is meant. :)

--
Phillip Gawlowski

From: Andrew Ting on
Yes thanks Philip, about the verbatim.

Anyone with any experience on this?

:)

============================================

Some of the cnf files found, which should be used?

/opt/local/var/macports/sources/rsync.macports.org/release/ports/databases/mysql4/files/my.cnf
/usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/federated/my.cnf
/usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/ndb/my.cnf
/usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/rpl/my.cnf
/usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/rpl_ndb/my.cnf


==============================================


i found a few my.cnf found and replaced with say:-

sudo gem install mysql --
--with-mysql-config=/usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/rpl_ndb/my.cnf

but got the following error :-

$ sudo gem install mysql --
--with-mysql-config=/usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/rpl_ndb/my.cnf
Building native extensions. This could take a while...
ERROR: Error installing mysql:
ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
extconf.rb
--with-mysql-config=/usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/rpl_ndb/my.cnf
extconf.rb:10: command not found:
/usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/rpl_ndb/my.cnf
--cflags


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


--
Posted via http://www.ruby-forum.com/.

From: Phillip Gawlowski on
On 21.12.2009 20:07, Andrew Ting wrote:
> Yes thanks Philip, about the verbatim.

It's Phillip, but you are still welcome. ;)

> /opt/local/var/macports/sources/rsync.macports.org/release/ports/databases/mysql4/files/my.cnf
This seems like the correct one.

> /usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/federated/my.cnf
> /usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/ndb/my.cnf
> /usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/rpl/my.cnf
> /usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/rpl_ndb/my.cnf

These seem to be config files for MySQL's test, looking at the path.

So, with any luck, if you use
/opt/local/var/macports/sources/rsync.macports.org/release/ports/databases/mysql4/files/my.cnf,
you should be finally set. :)

--
Phillip Gawlowski

From: Hassan Schroeder on
On Mon, Dec 21, 2009 at 11:07 AM, Andrew Ting <drikting(a)gmail.com> wrote:

> Some of the cnf files found, which should be used?
>
> /opt/local/var/macports/sources/rsync.macports.org/release/ports/databases/mysql4/files/my.cnf
> /usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/federated/my.cnf
> /usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/ndb/my.cnf
> /usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/rpl/my.cnf
> /usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/rpl_ndb/my.cnf

None of the above --

> i found a few my.cnf found and replaced with say:-
>
> sudo gem install mysql --
> --with-mysql-config=/usr/local/mysql-5.1.41-osx10.5-x86/mysql-test/suite/rpl_ndb/my.cnf

--with-mysql-config=/usr/local/mysql-5.1.41-osx10.5-x86/bin/mysql_config

is what you're looking for...

(The 'my.cnf' files are runtime configurations; you would copy an
appropriate version to /etc/my.cnf, but don't worry about that now.)

HTH,
--
Hassan Schroeder ------------------------ hassan.schroeder(a)gmail.com
twitter: @hassan