Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

gem install mysql problem in rails

Im getting an error with a rails app.

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

And when i try to do gem install mysql it still doesnt work and im getting this error.

WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and /usr/bin aren't both writable. WARNING: You don't have /Users/bartligthart/.gem/ruby/1.8/bin in your PATH, gem executables will not run.

I also tried this but it didn't work

sudo gem install mysql −− −−with−mysql−config≡/usr/local/mysql/bin/mysql_config

what could i do to install mysql?

like image 918
bartligthart Avatar asked Sep 02 '09 09:09

bartligthart


3 Answers

you need to install this first:

apt-get install libmysqlclient-dev
like image 89
Alex Avatar answered Nov 11 '22 08:11

Alex


Did you install the MySQL db server? If so, does this file actually exist?:

/usr/local/mysql/bin/mysql_config

If mysql isn't installed, install that first. Then make sure that the mysql_config script you point to is actually there.

like image 26
Bill Turner Avatar answered Nov 11 '22 09:11

Bill Turner


What worked for me is adding this to ~/.bash_profile:

export DYLD_LIBRARY_PATH=/usr/local/mysql/lib/

After installing the MySQL gem like this (64 bit version on an Intel osx 10.6):

export ARCHFLAGS="-arch x86_64" ; sudo gem install --no-rdoc --no-ri mysql -v 2.7 -- --with-mysql-dir=/usr/local --with-mysql-config=/usr/local/mysql/bin/mysql_config
like image 25
mahmoud Avatar answered Nov 11 '22 09:11

mahmoud