Forum: Ruby on Rails Problem with MYSQL after re-installing rails

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.
648a71a35ce6e4a1c5cd63451a2a20df?d=identicon&s=25 Gavin (Guest)
on 2009-04-07 12:54
(Received via mailing list)
Hey all-

Re-installed OSX yesterday and with it, Ruby and Rails

Now when I try to run db:migrate I get the error message:

"!!! The bundled mysql.rb driver has been removed from Rails 2.2.
Please install the mysql gem and try again: gem install mysql.
Rake aborted!

no such file to load -- mysql"


So, I try sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql

And get:
##########

Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
        ERROR: Failed to build gem native extension.

/usr/local/bin/ruby extconf.rb install mysql -- --with-mysql-dir=/usr/
local/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=/usr/local/bin/ruby
        --with-mysql-config
        --without-mysql-config
        --with-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 /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

##############

This seems to have been covered already here:
http://groups.google.com/group/rubyonrails-talk/br...

but I can't really follow what's happening there :S

Could anybody advise?

Ruby -v: ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin8.11.1]
Rails -v: Rails 2.3.2
All gems updated
36e6e719c742ff0b7231e673a3019c2c?d=identicon&s=25 Ruby Rails (Guest)
on 2009-04-07 13:00
(Received via mailing list)
Restart u'r computer or start u'r mysql server.Bassically this error
occur
due to not running of mysql server.
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-04-07 13:12
(Received via mailing list)
On Apr 7, 11:59 am, Ruby Rails <sanjible...@gmail.com> wrote:
> Restart u'r computer or start u'r mysql server.Bassically this error occur
> due to not running of mysql server.
>

Hog wash.

> > Rake aborted!
>
> > no such file to load -- mysql"
>
> > So, I try sudo gem install mysql -- --with-mysql-dir=/usr/local/mysql
>

Sorry to ask the stupid question, but have you installed mysql itself
along with everything else you did (and in that location)?

Fred
Ca5daf035ea2d72b6f263511bd132f50?d=identicon&s=25 Eric Bolden (Guest)
on 2009-04-07 13:33
(Received via mailing list)
Try installing the mysql gem with

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

from:
http://newwiki.rubyonrails.org/database-support/mysql
648a71a35ce6e4a1c5cd63451a2a20df?d=identicon&s=25 Gavin (Guest)
on 2009-04-07 20:22
(Received via mailing list)
@frederick

Yea - installed MYSQL from the package and it is running in the system
preferences pane- basically followed the steps on dan benjamins
tutorial on installing rails on OSX tiger.

@Eric - tried the command in terminal  - just got the same error.

Any suggestions guys?

thanks

On Apr 7, 12:11 pm, Frederick Cheung <frederick.che...@gmail.com>
851db84b78847b9188e80258e4028cc2?d=identicon&s=25 Dean Richardson (hikari17)
on 2009-04-07 20:36
All:

I'm encountering similar errors and difficulties.  When I enter:

sudo env ARCHFLAGS="-arch i386" gem install mysql --
--with-mysql-config=/usr /local/mysql/bin/mysql_config

as many have suggested, I still get the same "can't find header files
for ruby" error message:

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 install mysql --
--with-mysql-config=/usr/local/mysql/bin/mysql_config
can't find header files for ruby.


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

Any suggestions for diagnosing my mistake here?

Thanks!

Dean Richardson
648a71a35ce6e4a1c5cd63451a2a20df?d=identicon&s=25 Gavin (Guest)
on 2009-04-07 21:01
(Received via mailing list)
Yea - I noticed that Dean

If you work this out before me, do let me know
I'll be sure to do the same if I can get this working

:S

On Apr 7, 7:36 pm, Dean Richardson <rails-mailing-l...@andreas-s.net>
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-04-07 21:30
(Received via mailing list)
On Apr 7, 7:21 pm, Gavin <ga...@thinkersplayground.com> wrote:
> @frederick
>
> Yea - installed MYSQL from the package and it is running in the system
> preferences pane- basically followed the steps on dan benjamins
> tutorial on installing rails on OSX tiger.
>
> @Eric - tried the command in terminal  - just got the same error.
>
> Any suggestions guys?
>
using the --with-mysql-config  option usually works for me (pass it
the location of the mysql_config thing). Also make sure you have the
32 bit version of mysql, not 64 bit.

Fred
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-04-07 21:31
(Received via mailing list)
On Apr 7, 7:36 pm, Dean Richardson <rails-mailing-l...@andreas-s.net>
wrote:
>
> 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
>
> Any suggestions for diagnosing my mistake here?
>
That sounds like a different issue  ( in Gavin's case it just the
headers/libs for mysql it can't locate) - maybe you don't have all of
the stuff from the Dev tools you need ?

Fred
648a71a35ce6e4a1c5cd63451a2a20df?d=identicon&s=25 Gavin (Guest)
on 2009-04-08 01:26
(Received via mailing list)
Hmmm - have downloaded and re-installed MYSQL 5.1.33

Still getting the same issue.
In pref pane it shows that mysql is running.

Can anybody think of anything else I can check/do?

Really need to get my database back up and running soon :S

Thanks

On Apr 7, 8:31 pm, Frederick Cheung <frederick.che...@gmail.com>
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-04-08 09:14
(Received via mailing list)
On Apr 8, 12:25 am, Gavin <ga...@thinkersplayground.com> wrote:
> Hmmm - have downloaded and re-installed MYSQL 5.1.33
>
but did you get the 32bit version ? (and have you tried using --with-
mysql-config=/path/to/mysql_config ?)

Fred
648a71a35ce6e4a1c5cd63451a2a20df?d=identicon&s=25 Gavin (Guest)
on 2009-04-08 11:00
(Received via mailing list)
Yea - 32 bit version

I tried installing the mysql gem with

sudo gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/
mysql_config

and it worked! - kind of

Now when I run gem list it appears..


actionmailer (2.3.2, 2.1.0)
actionpack (2.3.2, 2.1.0)
activerecord (2.3.2, 2.1.0)
activerecord-jdbc-adapter (0.9.1)
activerecord-jdbcmysql-adapter (0.9.1)
activeresource (2.3.2, 2.1.0)
activesupport (2.3.2, 2.1.0)
arrayfields (4.7.2)
builder (2.1.2)
capistrano (2.5.5)
cgi_multipart_eof_fix (2.5.0)
chronic (0.2.3)
cucumber (0.2.3)
daemons (1.0.10)
diff-lcs (1.1.2)
fastthread (1.0.6)
fattr (1.0.3)
fixrbconfig (1.2)
gem_plugin (0.2.3)
highline (1.5.0)
hoe (1.12.1)
hpricot (0.8.1)
jdbc-mysql (5.0.4)
main (2.8.3)
mocha (0.9.5)
mongrel (1.1.5)

mysql (2.7)

net-scp (1.0.2)
net-sftp (2.0.2)
net-ssh (2.0.11)
net-ssh-gateway (1.0.1)
nifty-generators (0.2.3)
nokogiri (1.2.3)
orderedhash (0.0.6)
packet (0.1.15)
polyglot (0.2.5)
rack (0.9.1)
rails (2.3.2, 2.1.0)
rake (0.8.4)
redgreen (1.2.2)
rspec (1.2.2)
rspec-rails (1.2.2)
rubyforge (1.0.3)
rubygems-update (1.3.1)
sources (0.0.1)
sqlite3-ruby (1.2.4)
systemu (1.2.0)
term-ansicolor (1.0.3)
treetop (1.2.5)
webrat (0.4.3)
ZenTest (4.0.0)

However, when I try to run rake db:migrate or make a db query I get
this error:


!!! The bundled mysql.rb driver has been removed from Rails 2.2.
Please install the mysql gem and try again: gem install mysql.
rake aborted!
dlsym(0x103290, Init_mysql): symbol not found - /usr/local/lib/ruby/
gems/1.8/gems/mysql-2.7/lib/mysql.bundle


Any ideas guys?




On Apr 8, 8:13 am, Frederick Cheung <frederick.che...@gmail.com>
648a71a35ce6e4a1c5cd63451a2a20df?d=identicon&s=25 Gavin (Guest)
on 2009-04-08 11:29
(Received via mailing list)
VICTORY!

Installed an earlier version of MYSQL (5.0.37) and it all seems to be
working fine now

Thanks for your help fred
This topic is locked and can not be replied to.