Ruby Gem MySQL2 Install Failing

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



Leave a reply



Submit