简体   繁体   English

无法在Percona-XtraDB-Cluster上安装mysql gem

[英]Can't install mysql gem on Percona-XtraDB-Cluster

I saw there few topics about this problem, but none of them solved my problem. 我没有看到有关此问题的主题,但是没有一个解决了我的问题。

So. 所以。 Platform is CentOS 6.6. 平台是CentOS 6.6。 I have installed Percona-XtraDB-Cluster, their mysql-libs and their devel packages. 我已经安装了Percona-XtraDB-Cluster,他们的mysql-libs和他们的devel软件包。 Also i have there ruby 2.0.0 and rubygems 2.4.3. 我也在那里有红宝石2.0.0和红宝石2.4.3。 Now i am trying to install mysql gem. 现在,我正在尝试安装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. 这可能需要一段时间...错误:安装mysql时出错:错误:无法生成gem本机扩展。

/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. / opt / sensu / embedded / bin / ruby​​ -r ./siteconf20141114-16854-1fyrg9v.rb extconf.rb检查mysql_ssl_set()... * extconf.rb失败*由于某些原因而无法创建Makefile,可能是缺少必要的库和/或标头。 Check the mkmf.log file for more details. 检查mkmf.log文件以获取更多详细信息。 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=. 提供的配置选项:--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 --curdir --ruby = / opt / sensu / embedded / bin / ruby​​ --with-mysql-config --without-mysql-config /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb: 434:在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_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_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:in try_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:in block 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:in block (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:in block 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:in postpone' 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:in have_func' from extconf.rb:45: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'从/opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:534:在try_link' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:720:in从/opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:1004:in try_func” block in have_func' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:895:in中:在block (2 levels) in postpone' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:310:in :在block (2 levels) in postpone' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:310:in打开的块中/mkmf.rb:340 block in postpone' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:310:in打开状态,在/opt/sensu/embedded/lib/ruby/2.0中.0 / mkmf.rb:336: postpone' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:894:in in postpone' from /opt/sensu/embedded/lib/ruby/2.0.0/mkmf.rb:894:in /opt/sensu/embedded/lib/ruby/2.0 .0 / mkmf.rb:1003:in have_func' from extconf.rb:45:in '

extconf failed, exit code 1 extconf失败,退出代码1

Gem files will remain installed in /opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mysql-2.9.1 for inspection. 宝石文件将保留安装在/opt/sensu/embedded/lib/ruby/gems/2.0.0/gems/mysql-2.9.1中以进行检查。 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 结果记录到/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 我在网上发现的任何描述的解决方案都无济于事,因此,也许有人对此Percona群集,ruby-2.0.0和gem mysql-2.9.1有类似的问题。

Looks like you need development libraries for the Ruby gem MySQL with SSL: 看起来您需要带SSL的Ruby gem MySQL开发库:

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: 然后尝试安装较新的mysql2 gem:

 gem install mysql2 --version '>=0.3.17'

Sensu expects SSL, so it is good to have it. Sensu期望使用SSL,因此拥有SSL是一件好事。 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". Sensu文档说:“可以在不使用SSL的情况下使用Sensu,但是强烈建议不要这样做。以下说明使用一种工具来生成自签名的OpenSSL证书”。 Read about how to enable SSL here: 在此处阅读有关如何启用SSL的信息:

http://sensuapp.org/docs/latest/certificates#documentation

If you want SSL, you may want to ensure that your database does have SSL enabled: 如果需要SSL,则可能要确保数据库确实启用了SSL:

> 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. 您在注释中写道,您无法安装mysql-develmysql-server因为它们将与percona冲突。 My guess is that the error is the older mysql gem and/or the need for SSL. 我的猜测是错误是较旧的mysql gem和/或对SSL的需求。

If you are using rvm , it can also cause these kinds of glitches. 如果您使用的是rvm ,它也可能导致此类故障。 You may want to try ruby-install and installing the current ruby. 您可能要尝试ruby-install并安装当前的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-install ruby 2.1.5 --install-dir ~/foo/bar/

If you are using sudo gem install , it can also cause glitches for native gems. 如果您使用sudo gem install ,它也可能导致本机gem出现故障。 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: 您可能想尝试成为root用户,并使用实际的root环境和root ruby​​版本,并再次检查ruby版本是否符合您的期望,如下所示:

 $ sudo su - 
 # which ruby
 # ruby --version
 # gem install mysql2 --version '>=0.3.17'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM