11

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.

qiao
  • 17,941
  • 6
  • 57
  • 46
Pierre Develop
  • 113
  • 1
  • 6
  • 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 Jan 16 '12 at 00:17
  • 3
    have you had a look at these pages, http://stackoverflow.com/questions/3608287/installing-mysql2-gem-for-rails-3 http://stackoverflow.com/questions/8029832/heroku-dbpull-cant-connect-to-my-db-in-ubuntu http://stackoverflow.com/questions/7967648/facing-error-installing-mysql2-gem/8616459#8616459 – Hishalv Jan 16 '12 at 06:33
  • It sounds like you haven't got MySQL installed on your machine. –  Jan 16 '12 at 19:12
  • What is the result of doing `gem install mysql2 -v '0.2.17'` ? – Michael Durrant Jan 16 '12 at 20:19

2 Answers2

24

Most folks find this works:

sudo apt-get install libmysql-ruby libmysqlclient-dev
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
0

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?

eckes
  • 64,417
  • 29
  • 168
  • 201