5

I am trying to install a gem on linux but it is giving 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?

Frederick Cheung
  • 83,189
  • 8
  • 152
  • 174
priyamoralwar
  • 51
  • 1
  • 2

2 Answers2

16

Probably, it can't build mysql2 native extension.

If you're using Ubuntu 14.04 or newer, try sudo apt-get install ruby-mysql libmysqlclient-dev.

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

On OS X: brew install mysql

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

Community
  • 1
  • 1
Resure
  • 436
  • 7
  • 17
0

I was using LInux 16 Cinnamon and got that error message. I used "Resure"'s, solution sudo apt-get install libmysql-ruby libmysqlclient-dev

then ran bundle install for project.

It worked!

user3386050
  • 146
  • 1
  • 10