I saw there few topics about this problem, but none of them solved my problem.
So. Platform is CentOS 6.6. I have installed Percona-XtraDB-Cluster, their mysql-libs and their devel packages. Also i have there ruby 2.0.0 and rubygems 2.4.3. Now i am trying to install mysql gem. What i am getting:
Building native extensions. This could take a while... ERROR: Error installing mysql: ERROR: Failed to build gem native extension.
/opt/sensu/embedded/bin/ruby -r ./siteconf20141114-16854-1fyrg9v.rb extconf.rb checking for mysql_ssl_set()... * 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.
Provided configuration options: --with-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/opt/sensu/embedded/bin/ruby --with-mysql-config --without-mysql-config /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:434:in
try_do': The compiler failed to generate an executable file. (RuntimeError) You have to install development tools first. from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:519:in
try_link0' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:534:intry_link' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:720:in
try_func' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:1004:inblock in have_func' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:895:in
block in checking_for' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:340:inblock (2 levels) in postpone' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:310:in
open' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:340:inblock in postpone' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:310:in
open' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:336:inpostpone' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:894:in
checking_for' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:1003:inhave_func' from extconf.rb:45:in
'extconf failed, exit code 1
Gem files will remain installed in /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mysql-2.9.1 for inspection. Results logged to /opt/sensu/embedded/lib/ruby/gems/2.0.0/extensions/x86_64-linux/2.0.0/mysql-2.9.1/gem_make.out
Any of described solutions, which i found on the web didn't help me, so, maybe someone had similar problems with this Percona cluster and ruby-2.0.0 and gem mysql-2.9.1
Looks like you need development libraries for the Ruby gem MySQL with SSL:
Try each of these:
Then try installing the newer
mysql2
gem:Sensu expects SSL, so it is good to have it. The Sensu documentation says " It is possible to use Sensu without SSL, however, it is heavily discouraged. The following instructions use a tool to generate self-signed OpenSSL certificates". Read about how to enable SSL here:
If you want SSL, you may want to ensure that your database does have SSL enabled:
You wrote in the comment that you can't install
mysql-devel
andmysql-server
because they will conflict with percona. My guess is that the error is the oldermysql
gem and/or the need for SSL.If you are using
rvm
, it can also cause these kinds of glitches. You may want to tryruby-install
and installing the current ruby. This may bring in the dependencies you need. If you want, you can useruby-install
in a custom directory, like this:If you are using
sudo gem install
, it can also cause glitches for native gems. You may want to try becoming root, and using the actual root environment, and the root ruby version, and double-checking that the ruby version is what you expect, like this: