Ruby gem mysql2 install failing
You have to have 64-bit MySQL installed on your machine, plus the build tools you get when you install xcode.
Ruby gem mysql2 install error
Since this keeps coming up on google as on of the top results, I should point out that this answers is from almost 2 years ago. Here is a more updated answer: How to use "mysql2" gem in Rails 3 application on Windows 7?
According to the developer there is a already a reported bug for it and he is working on parting mysql2 over to Windows. As of now - it's still in the works. Use the older mysql driver for now - or use sqlite for local development.
This is from the googlegroups discussion
Blockquote
Hey Erwann,
There's a ticket on the mysql2 issue tracker for Win32 support already
at http://github.com/brianmario/mysql2/issues#issue/8 . You can follow
it for progress; I'm doing my best to get things working smoothly for
you guys. Hang tight! :)
An error occurred while installing mysql2 (0.5.4), and Bundler cannot continue - in rails project
It is an open issue with mysql2 though there is a workaround. Check this thread from GitHub the last comment is the thing you need.
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
Installing Mysql 2 gem fails
You're installing an older version of the gem (0.4.5). I had the same issue (using 0.4.3). Installing version 0.4.10 solved this for me.
Try this:
gem install mysql2 -v 0.4.10
If that installs cleanly, you'll have to update your Gemfile
to require this version:
gem 'mysql2', '~> 0.4.10'
Don't install a newer version of the gem (i.e. 0.5.x), they won't work with Rails 4 or older releases of Rails 5 (before 5.0.7/5.1.6) (see https://github.com/brianmario/mysql2/issues/950).
Related Topics
Dplyr Left_Join by Less Than, Greater Than Condition
How to Create Id With Auto_Increment on Oracle
Search All Fields in All Tables For a Specific Value (Oracle)
Querying Spark SQL Dataframe With Complex Types
SQL Left Join VS Multiple Tables on from Line
MySQL - How to Unpivot Columns to Rows
What This Query Does to Create Comma Delimited List SQL Server
Group by Minimum Value in One Field While Selecting Distinct Rows
Difference Between Oracle'S Plus (+) Notation and Ansi Join Notation
Set Versus Select When Assigning Variables
Pass R Variable to Rodbc'S Sqlquery
SQL Join and Different Types of Joins
How to Perform an If...Then in an SQL Select
MySQL: @Variable Vs. Variable. What's the Difference
Entity Attribute Value Database Vs. Strict Relational Model Ecommerce
How to Load a Large Number of Strings to Match With Oracle Database
Group by Clause in MySQL and Postgresql, Why the Error in Postgresql
How to Pass Column Name as Input Parameter in SQL Stored Procedure