Error Installing MySQL2: Failed to Build Gem Native Extension

Error installing mysql2: Failed to build gem native extension

On Ubuntu/Debian and other distributions using aptitude:

sudo apt-get install libmysql-ruby libmysqlclient-dev

Package libmysql-ruby has been phased out and replaced by ruby-mysql. This is where I found the solution.

If the above command doesn't work because libmysql-ruby cannot be found, the following should be sufficient:

sudo apt-get install libmysqlclient-dev

On Red Hat/CentOS and other distributions using yum:

sudo yum install mysql-devel

On Mac OS X with Homebrew:

brew install mysql

MySQL2 with native extensions ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

I realized I didn't have mySQL installed, I recently upgraded to Lion, and had forgotten to install mySQL. Still, after that I got some issues, I followed this article to setup everything:

http://weblog.rubyonrails.org/2009/8/30/upgrading-to-snow-leopard

And now everything works fine.

ERROR: Failed to build gem native extension - Error installing mysql2

which OS are you using?

anyway if you are using ubuntu, from this https://github.com/brianmario/mysql2/issues/8
run:

sudo apt-get install mysql-client libmysqlclient-dev

Otherwise for Mac users,(use brew to install) check this Link, or run:

brew install mysql

then

sudo gem install mysql2

and for windows users check the link below for a solution.
Error installing mysql2: Failed to build gem native extension

I would recommend to use the normal command prompt.

Error installing mysql2 gem: Failed to build gem native extension

Just for the record: The problem should be solved!

The mysql2 gem v.0.2.6 is out, having win32 support.

gem install mysql2 worked without problems now (DevKit installed).

See: http://github.com/brianmario/mysql2/issues/issue/8#issue/8/comment/479748

ERROR: Failed to build gem native extension (mysql2 on rails 3.2.3)

I ended up just installing a fresh copy of MySQL and not using MAMP and that did the trick. Also had to be sure to install the 64-bit version, not 32-bit.



Related Topics



Leave a reply



Submit