Install mysql2 gem on linux

I am trying to install gem on linux, but it gives me an error:

An error occured while installing mysql2 (0.3.11), and Bundler cannot continue.
Make sure that gem install mysql2 -v '0.3.11' succeeds before bundling.

What do i need to do now?

+5
source share
2 answers

Perhaps he cannot build his own mysql2 extension.

If you are using Ubuntu 14.04 or later, give it a try sudo apt-get install ruby-mysql libmysqlclient-dev.

On older versions of Ubuntu, install this: sudo apt-get install libmysql-ruby libmysqlclient-dev

In OS X: brew install mysql

There are also similar questions: 1 , 2 , 3 .

+16
source

I used Linnux 16 Cinnamon and got this error message. I used "Resure", a solution sudo apt-get install libmysql-ruby libmysqlclient-dev

then installed the package for the project.

It worked!

0
source

All Articles