views:

705

answers:

5

Hello,

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?

+1  A: 

Try

sudo gem update --include-dependencies
sudo gem install mysql
sudo apt-get install libsqlite3-dev
sudo gem install sqlite3-ruby
Senthil Kumar Bhaskaran
when i did the sude gem install mysqlit gave this errorERROR: Error installing mysql: ERROR: Failed to build gem native extension.
bartligthart
A: 

This article helped me at the time: http://craiccomputing.blogspot.com/2008/11/installing-rails-22-on-mac-os-x-mysql.html

benvds
A: 

To fix that, add "gem: --no-user-install" in your ~/.gemrc file via

Pie
A: 

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.

Bill Turner
A: 

Seems like an old topic, but in case someone still needs it. I found this article: http://www.bin-co.com/blog/2009/04/error-connection-mysql-ruby-rails-linux-solution/

You need to install these libraries if you are on Ubuntu: sudo apt-get install libmysqlclient15-dev libmysqlclient15off libmysql-ruby And then gem sudo gem install mysql -- --with-mysql-config=/usr/bin/mysql_config

That worked for me. Hope that helps

Liutauras