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
The MySQL Extension Is Deprecated and Will Be Removed in the Future: Use MySQLi or Pdo Instead
Insert Results of a Stored Procedure into a Temporary Table
How to (Or Can I) Select Distinct on Multiple Columns
Count Work Days Between Two Dates
Ordering by the Order of Values in a SQL In() Clause
How to Generate a Range of Numbers Between Two Numbers
Delete Duplicate Rows from Small Table
MySQL Select Only Not Null Values
Xcode 4 and Core Data: How to Enable SQL Debugging
Only Inserting a Row If It's Not Already There
How to Update Two Tables in One Statement in SQL Server 2005
Any Downsides of Using Data Type "Text" For Storing Strings