Problem with MYSQL after re-installing rails

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:

Restart u’r computer or start u’r mysql server.Bassically this error occur due to not running of mysql server.

Restart u'r computer or start u'r mysql server.Bassically this error occur
due to not running of mysql server.

Hog wash.

> 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

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

Fred

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

@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

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

@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

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

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

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

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?

VICTORY!

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

Thanks for your help fred