11
votes

I get this error

Gem files will remain installed in
/home/mark/.bundler/tmp/28288/gems/mysql2-0.2.17 for inspection.
Results logged to
/home/mark/.bundler/tmp/28288/gems/mysql2-0.2.17/ext/mysql2/gem_make.out
An error occured while installing mysql2 (0.2.17), and Bundler cannot
continue. Make sure that gem install mysql2 -v '0.2.17' succeeds
before bundling.

With a Ruby on Rails application and I can not solve it.

2
The cause of your problem is most probably in /home/mark/.bundler/tmp/28288/gems/mysql2-0.2.17/ext/mysql2/gem_make.out. And we can't help you wiothout knowing the contents of that file.Holger Just
It sounds like you haven't got MySQL installed on your machine.user358380
What is the result of doing gem install mysql2 -v '0.2.17' ?Michael Durrant

2 Answers

24
votes

Most folks find this works:

sudo apt-get install libmysql-ruby libmysqlclient-dev
0
votes

It's probably a compilation error. Maybe you don't have mysql development libs installed in your system.

I need to see the logs to make sure. Try it and paste the output here:

cat /home/mark/.bundler/tmp/28288/gems/mysql2-0.2.17/ext/mysql2/gem_make.out 

Btw: wich operation system are you using?