Reputation: 63
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
Upvotes: 1
Views: 631
Reputation: 35443
Looks like you need development libraries for the Ruby gem MySQL with SSL:
Try each of these:
yum install gcc
yum install mysql mysql-devel mysql-server
yum install openssl openssl-devel
yum install ruby-devel
Then try installing the newer mysql2
gem:
gem install mysql2 --version '>=0.3.17'
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:
http://sensuapp.org/docs/latest/certificates#documentation
If you want SSL, you may want to ensure that your database does have SSL enabled:
> show variables like '%ssl%';
+---------------+-------+
| Variable_name | Value |
+---------------+-------+
| have_openssl | YES |
| have_ssl | YES |
...
You wrote in the comment that you can't install mysql-devel
and mysql-server
because they will conflict with percona. My guess is that the error is the older mysql
gem and/or the need for SSL.
If you are using rvm
, it can also cause these kinds of glitches. You may want to try ruby-install
and installing the current ruby. This may bring in the dependencies you need. If you want, you can use ruby-install
in a custom directory, like this:
$ ruby-install ruby 2.1.5 --install-dir ~/foo/bar/
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:
$ sudo su -
# which ruby
# ruby --version
# gem install mysql2 --version '>=0.3.17'
Upvotes: 1