Erro de compilação do mysql2 gem ao instalar o redmine

Erro de compilação do mysql2 gem ao instalar o redmine

quando tentei instalar o redmine, bundle install --without development test recebi este erro de compilação:

Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...................................
Installing rake 10.3.2
...(and so on)

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/home/pi/.rubies/ruby-2.1.5/bin/ruby extconf.rb
checking for ruby/thread.h... yes
checking for rb_thread_call_without_gvl() in ruby/thread.h... yes
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for rb_hash_dup()... yes
checking for rb_intern3()... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lm... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lz... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lsocket... no
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lnsl... yes
checking for mysql_query() in -lmysqlclient... no
checking for main() in -lmygcc... no
checking for mysql_query() in -lmysqlclient... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

...

Gem files will remain installed in /home/pi/.gem/ruby/2.1.5/gems/mysql2-0.3.17 for inspection.
Results logged to /home/pi/.gem/ruby/2.1.5/extensions/armv6l-linux/2.1.0-static/mysql2-0.3.17/gem_make.out
An error occurred while installing mysql2 (0.3.17), and Bundler cannot continue.
Make sure that `gem install mysql2 -v '0.3.17'` succeeds before bundling.

Eu tentei ler .gem/ruby/2.1.5/extensions/armv6l-linux/2.1.0-static/mysql2-0.3.17/mkmf.logque está cheio de saída de verificação de código gcc com mensagens de erro semelhantes às presentes na saída básica que postei acima.

Também tentei executar o comando da mensagem de erro ( gem install mysql2 -v '0.3.17'), mas é claro que também falhou com o mesmo resultado. Qual pode ser a origem desses erros? Sou bastante novo no ambiente Linux, então deixo os automatizadores fazerem tudo por mim e estou seguindo os guias (este neste caso)

Pode haver algum problema com o mysql que já está instalado pelo apt-get junto com o apache?

PS: É uma distribuição raspbian/debian.

Responder1

encontrei uma solução

o que resolveu meu problema foi uma (ou ambas) dessas duas instalações:

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

provavelmente o posterior

instalei ambos antes de verificar, então não posso ter certeza

informação relacionada