Forum: Ruby on Rails mysql install problem

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
2162ccfdd944b7d2c5327291b7d4f5cc?d=identicon&s=25 Eduardo Cirilo (edcirilo)
on 2009-02-09 14:50
Hi,


I got Mac OS X 15.6 installed, Locomotive 2.0.8 and MYSQL 5.0.67
running. I'm having this problem when I try to install mysql gem:

Last login: Mon Feb  9 13:37:37 on ttys001
source
/var/folders/be/bexGvm9pHdq0vcEmR8-WWk+++TM/-Tmp-//39E424DB-A260-4E41-AA2E-30B64FB46F3C-7395-00002254065EA712.environment.bash
You have mail.
MBPEduCirilo:~ eduardocirilo$ source
/var/folders/be/bexGvm9pHdq0vcEmR8-WWk+++TM/-Tmp-//39E424DB-A260-4E41-AA2E-30B64FB46F3C-7395-00002254065EA712.environment.bash
MBPEduCirilo:kshema098 eduardocirilo$ gem install mysqlBuilding native
extensions.  This could take a while...ERROR:  Error installing mysql:
  ERROR: Failed to build gem native extension.

/Applications/EdUtils/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/bin/ruby
extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... 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=/Applications/EdUtils/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/bin/ruby
  --with-mysql-config
  --without-mysql-config
  --with-mysql-dir
  --without-mysql-dir
  --with-mysql-include
  --without-mysql-include=${mysql-dir}/include
  --with-mysql-lib
  --without-mysql-lib=${mysql-dir}/lib
  --with-mysqlclientlib
  --without-mysqlclientlib
  --with-mlib
  --without-mlib
  --with-mysqlclientlib
  --without-mysqlclientlib
  --with-zlib
  --without-zlib
  --with-mysqlclientlib
  --without-mysqlclientlib
  --with-socketlib
  --without-socketlib
  --with-mysqlclientlib
  --without-mysqlclientlib
  --with-nsllib
  --without-nsllib
  --with-mysqlclientlib
  --without-mysqlclientlib


Gem files will remain installed in
/Applications/EdUtils/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/mysql-2.7
for inspection.
Results logged to
/Applications/EdUtils/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8/gems/mysql-2.7/gem_make.out
MBPEduCirilo:kshema098 eduardocirilo$






And when I type the rake command it shows:

MBPEduCirilo:kshema098 eduardocirilo$ rake db:migrate
(in /Users/eduardocirilo/Documents/WWW/kshema098)
Missing these required gems:
  mysql

You're running:
  ruby 1.8.4 at
/Applications/EdUtils/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/bin/ruby
  rubygems 1.3.1 at /Users/eduardocirilo/.gem/ruby/1.8,
/Applications/EdUtils/Locomotive2/Bundles/standardRailsSept2006.locobundle/i386/lib/ruby/gems/1.8

Run `rake gems:install` to install the missing gems.
MBPEduCirilo:kshema098 eduardocirilo$





What can I do to resolve this problem? I really need some help m8s.

Regards,
Ed
80e4cb97cae5c8d745f72337d93fd8f2?d=identicon&s=25 MaD (Guest)
on 2009-02-09 15:24
(Received via mailing list)
your post says:
  'You're running:  ruby 1.8.4'

while on ror.org is written:
  'We recommend Ruby 1.8.7 for use with Rails.'

1.8.4 should work, too. but to make sure it ain't a version-conflict,
i'd update.

other than that, did you follow this hint?:
  'OS X 10.5: Included with developer tools (then do "gem update
rails")'
2162ccfdd944b7d2c5327291b7d4f5cc?d=identicon&s=25 Eduardo Cirilo (edcirilo)
on 2009-02-09 15:56
MaD wrote:
> your post says:
>   'You're running:  ruby 1.8.4'
>
> while on ror.org is written:
>   'We recommend Ruby 1.8.7 for use with Rails.'
>
> 1.8.4 should work, too. but to make sure it ain't a version-conflict,
> i'd update.
>
> other than that, did you follow this hint?:
>   'OS X 10.5: Included with developer tools (then do "gem update
> rails")'


Hi MaD,

When I try to update it appens this:

MBPEduCirilo:kshema098 eduardocirilo$ gem update rails
Updating installed gems
Nothing to update


How can I update to Ruby 1.8.7? Is there another way?

Regards,
Ed
B8ac655007757eafd492a3c519f19d33?d=identicon&s=25 Manisha Tripathy (manisha)
on 2009-02-09 16:40
Have you installed mysql-client?
2162ccfdd944b7d2c5327291b7d4f5cc?d=identicon&s=25 Eduardo Cirilo (edcirilo)
on 2009-02-09 18:23
Manisha Tripathy wrote:
> Have you installed mysql-client?



Yes I have...
Bbbc7c2470ee942c9fd13abebb709b4f?d=identicon&s=25 Brent Miller (macstruan)
on 2009-02-09 23:08
If you're on an Intel mac, try this:

sudo env ARCHFLAGS="-arch i386" gem install mysql --
--with-mysql-dir=/usr/local/mysql
sudo ln -s /usr/local/mysql/lib /usr/local/mysql/lib/mysql

Just be sure to get the mysql directories right to match your system
setup.  These are the default for the MySQL binaries.

Brent

Eduardo Cirilo wrote:
> Manisha Tripathy wrote:
>> Have you installed mysql-client?
>
>
>
> Yes I have...
E41ff53614fcbf599d07b0d55bd18269?d=identicon&s=25 Chad (Guest)
on 2009-02-09 23:19
(Received via mailing list)
You're trying to update the rails framework, not ruby.

http://www.ruby-lang.org/en/downloads/



On Feb 9, 6:56 am, Eduardo Cirilo <rails-mailing-l...@andreas-s.net>
80e4cb97cae5c8d745f72337d93fd8f2?d=identicon&s=25 MaD (Guest)
on 2009-02-10 08:44
(Received via mailing list)
^ make sure you'Re getting 1.8.7 (which is the latest stable). 1.9.1
still causes problems with some gems.
2162ccfdd944b7d2c5327291b7d4f5cc?d=identicon&s=25 Eduardo Cirilo (edcirilo)
on 2009-02-10 19:57
Hi,

I'm still having the problem...here what it says:



Run `rake gems:install` to install the missing gems.
MBPEduCirilo:kshema098 eduardocirilo$ rake gems:install
(in /Users/eduardocirilo/Desktop/kshema098)
gem install mysql
WARNING:  Installing to ~/.gem since /opt/local/lib/ruby/gems/1.8 and
    /opt/local/bin aren't both writable.
WARNING:  You don't have /Users/eduardocirilo/.gem/ruby/1.8/bin in your
PATH,
    gem executables will not run.
ERROR:  Error installing mysql:
  ERROR: Failed to build gem native extension.

/opt/local/bin/ruby extconf.rb install mysql
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... no
checking for mysql_query() in -lmysqlclient... 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=/opt/local/bin/ruby
  --with-mysql-config
  --without-mysql-config
  --with-mysql-dir
  --without-mysql-dir
  --with-mysql-include
  --without-mysql-include=${mysql-dir}/include
  --with-mysql-lib
  --without-mysql-lib=${mysql-dir}/lib
  --with-mysqlclientlib
  --without-mysqlclientlib
  --with-mlib
  --without-mlib
  --with-mysqlclientlib
  --without-mysqlclientlib
  --with-zlib
  --without-zlib
  --with-mysqlclientlib
  --without-mysqlclientlib
  --with-socketlib
  --without-socketlib
  --with-mysqlclientlib
  --without-mysqlclientlib
  --with-nsllib
  --without-nsllib
  --with-mysqlclientlib
  --without-mysqlclientlib


Gem files will remain installed in
/Users/eduardocirilo/.gem/ruby/1.8/gems/mysql-2.7 for inspection.
Results logged to
/Users/eduardocirilo/.gem/ruby/1.8/gems/mysql-2.7/gem_make.out
Building native extensions.  This could take a while...
Loaded suite /opt/local/bin/rake
Started

Finished in 0.000433 seconds.

0 tests, 0 assertions, 0 failures, 0 errors
MBPEduCirilo:kshema098 eduardocirilo$ rake db:migrate
(in /Users/eduardocirilo/Desktop/kshema098)
Missing these required gems:
  mysql

You're running:
  ruby 1.8.7.72 at /opt/local/bin/ruby
  rubygems 1.3.1 at /Users/eduardocirilo/.gem/ruby/1.8,
/opt/local/lib/ruby/gems/1.8

Run `rake gems:install` to install the missing gems.
MBPEduCirilo:kshema098 eduardocirilo$


What must I do?
Bbbc7c2470ee942c9fd13abebb709b4f?d=identicon&s=25 Brent Miller (macstruan)
on 2009-02-10 20:02
Check here: http://foliosus.com/blog/howto-install-mysql-gem-on-leopard

Be sure to read the comments -- there is a fix in the comments for the
install command that might help you.
2162ccfdd944b7d2c5327291b7d4f5cc?d=identicon&s=25 Eduardo Cirilo (edcirilo)
on 2009-02-10 20:08
Done !!!

What a lot of headache :S

Thanks for all m8s...
23ae9e75998020bacd139c7a5da311fc?d=identicon&s=25 David Herman (Guest)
on 2009-02-10 23:07
(Received via mailing list)
you might also consider using sudo so it wont install in .gem

On Tue, Feb 10, 2009 at 2:08 PM, Eduardo Cirilo <
57862e3a0221453454ede7c096e232f8?d=identicon&s=25 Tom Milewski (Guest)
on 2009-02-22 00:17
(Received via mailing list)
I'm having the same issue except it happens when I simply do:

sudo gem install mysql

Does anyone know of a fix?

I've tried just about everything.

On Feb 10, 1:57 pm, Eduardo Cirilo <rails-mailing-l...@andreas-s.net>
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-02-22 00:26
(Received via mailing list)
On Feb 21, 6:55 pm, Tom Milewski <tmilew...@gmail.com> wrote:
> I'm having the same issue except it happens when I simply do:
>
> sudo gem install mysql
>
> Does anyone know of a fix?

you need to tell the install scripts where the mysql libraries/headers
are (eg see the link Brent posted)
>
> I've tried just about everything.
>
While I'm sure you may feel that way (I'm sure we can all empathise
with that) it's a singularly unhelpful thing to say, you could very
easily put off the person with the answer by making them think "oh,
he's probably already tried what I was going to suggest".

Fred
This topic is locked and can not be replied to.