捆绑软件安装问题:缺少mysql.h [英] bundle install problem: mysql.h is missing

查看:58
本文介绍了捆绑软件安装问题:缺少mysql.h的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的32位Mac OSX 10.6中,我可以很容易地安装mysql2 gem,但是在mini mac 10.6 64位服务器中却不能。



我已经安装了MySQL 5.5.11在麻烦的服务器中,而在我的家庭Mac中,MySQL 5.5.0.m2
以某种方式运行捆绑安装时,在服务器中,它试图在家庭mysql2.0.2.6中安装mysql2.0.3.2。 b
$ b

请不要告诉我



env ARCHFLAGS =-arch x86_64 sudo gem install mysql2 --version'= 0.2 .6'---with-mysql-config = / usr / local / mysql / bin / mysql_config



我尝试过,不起作用。



$ PATH中包含的/ usr / local / mysql / bin也无济于事。



错误代码:

 安装本机扩展为/Users/administrator/.rvm/rubies/ruby-1.9.2-p180/的mysql2(0.3.2) lib / ruby​​ / site_ruby / 1.9.1 / ruby​​gems / installer.rb:533:在`build_extensions中的块中进行救援':错误:无法构建gem本机扩展。 (Gem :: Installer :: ExtensionBuildError)

/Users/administrator/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb
检查rb_thread_blocking_region() ...是
正在检查mysql.h ...否
正在检查mysql / mysql.h ...否
-----
缺少mysql.h 。请检查您的mysql安装,然后重试。
-----
*** extconf.rb失败***
由于某些原因(可能缺少
必需的库和/或头文件)而无法创建Makefile。检查mkmf.log文件以获取更多
详细信息。您可能需要配置选项。

提供的配置选项:
--with-opt-dir
--without-opt-dir
--with-opt-include
- -without-opt-include = $ {opt-dir} / include
--with-opt-lib
--without-opt-lib = $ {opt-dir} / lib
--with-make-prog
-没有make-prog
--srcdir =。
--curdir
--ruby = / Users / administrator / .rvm / rubies / ruby​​-1.9.2-p180 / bin / ruby​​
--with-mysql-config
--without-mysql-config


宝石文件将继续安装在/Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3中。 2进行检查。
结果记录到/ Users / administrator /中的/Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3.2/ext/mysql2/gem_make.out
.rvm / rubies / ruby​​-1.9.2-p180 / lib / ruby​​ / site_ruby / 1.9.1 / ruby​​gems / installer.rb:511:在/Users/administrator/.rvm/中的build_extensions中的
中rubies / ruby​​-1.9.2-p180 / lib / ruby​​ / site_ruby / 1.9.1 / ruby​​gems / installer.rb:486:位于/Users/administrator/.rvm/rubies/ruby-1.9的
中.2-p180 / lib / ruby​​ / site_ruby / 1.9.1 / ruby​​gems / installer.rb:486:在/users/administrator/.rvm/rubies/ruby-1.9.2-p180/中的'build_extensions'
中lib / ruby​​ / site_ruby / 1.9.1 / ruby​​gems / installer.rb:159:在/users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0的'install'
中.12 / lib / bundler / source.rb:96:在/users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/中的'install'
中bundler / installer.rb:55:在/Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/spec_set中的'运行中阻止'
.rb:12:in来自/Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/spec_set.rb:12:in中的
中的每个块
来自/Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/spec_set.rb:12:in`each'
来自/Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/installer.rb:44:在/ Users / administrator /中的'run'
中.rvm / gems / ruby​​-1.9.2-p180 / gems / bundler-1.0.12 / lib / bundler / installer.rb:8:在/Users/administrator/.rvm/gems/中的'install'
中ruby-1.9.2-p180 / gems / bundler-1.0.12 / lib / bundler / cli.rb:225:在/users/administrator/.rvm/gems/ruby-1.9.2的'install'
中-p180 / gems / bundler-1.0.12 / lib / bundler / vendor / thor / task.rb:22:在来自/Users/administrator/.rvm/gems/ruby-1.9.2-的'run'
中p180 / gems / bundler-1.0.12 / lib / bundler / vendor / thor / invocation.rb:118:在/Users/administrator/.rvm/gems/ruby-1.9.2-p180中的'invoke_task'
中/gems/bundler-1.0.12/lib/bundler/vendor/thor.rb:246:在`dispatch'中
来自/Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/vendor/thor/base.rb:389:in`start'
from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/bin/bundle:13:in`< top(required)>'
从/Users/administrator/.rvm/gems/ruby-1.9.2-p180/bin/bundle:19:在`load'
from /Users/administrator/.rvm/gems/ruby-1.9.2 -p180 / bin / bundle:19:in'< main>'


解决方案

我尝试了此处发布的所有解决方案,但并不幸运。我用自制软件重新安装了mysql几次,仍然没有运气。然后我遇到了一个博客,提供了解决方案。



我在 /usr/local/Cellar/mysql/5.6.12中编辑了mysql_config文件。 / bin 并删除了
W编译器选项
-Wno-null-conversion
-Wno-unused-private-field
用于cflag和cxxflags。



这解决了 gem安装mysql2 捆绑安装



参考: http://www.randomactsofsentience.com/2013/ 05 / gem-install-mysql2-missing-mysqlh-on-os.html


in my mac OSX 10.6 32 bit, I can install mysql2 gem quite easily, but not in mini mac 10.6 64bit server.

I have installed MySQL 5.5.11 in troublesome server, while in my home mac MySQL 5.5.0.m2 Somehow when I run bundle install, in server it tries to install mysql2.0.3.2 while in home mysql2.0.2.6

Please don't tell me to

env ARCHFLAGS="-arch x86_64" sudo gem install mysql2 --version '= 0.2.6' -- --with-mysql-config=/usr/local/mysql/bin/mysql_config

I tried that, doesn't work.

Included /usr/local/mysql/bin in $PATH does not help as well.

Error code:

    Installing mysql2 (0.3.2) with native extensions /Users/administrator/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:533:in `rescue in block in build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

        /Users/administrator/.rvm/rubies/ruby-1.9.2-p180/bin/ruby extconf.rb 
checking for rb_thread_blocking_region()... yes
checking for mysql.h... no
checking for mysql/mysql.h... no
-----
mysql.h is missing.  please check your installation of mysql and try again.
-----
*** 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
    --without-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=/Users/administrator/.rvm/rubies/ruby-1.9.2-p180/bin/ruby
    --with-mysql-config
    --without-mysql-config


Gem files will remain installed in /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3.2 for inspection.
Results logged to /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/mysql2-0.3.2/ext/mysql2/gem_make.out
    from /Users/administrator/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:511:in `block in build_extensions'
    from /Users/administrator/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:486:in `each'
    from /Users/administrator/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:486:in `build_extensions'
    from /Users/administrator/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/installer.rb:159:in `install'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/source.rb:96:in `install'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/installer.rb:55:in `block in run'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/spec_set.rb:12:in `block in each'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/spec_set.rb:12:in `each'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/spec_set.rb:12:in `each'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/installer.rb:44:in `run'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/installer.rb:8:in `install'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/cli.rb:225:in `install'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/vendor/thor/task.rb:22:in `run'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/vendor/thor.rb:246:in `dispatch'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/lib/bundler/vendor/thor/base.rb:389:in `start'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/gems/bundler-1.0.12/bin/bundle:13:in `<top (required)>'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/bin/bundle:19:in `load'
    from /Users/administrator/.rvm/gems/ruby-1.9.2-p180/bin/bundle:19:in `<main>'

解决方案

I tried all the solutions posted here, but was not lucky. I reinstalled mysql with homebrew a couple of times and still no luck. Then I came across a blog post with a solution.

I edited the mysql_config file in /usr/local/Cellar/mysql/5.6.12/bin and removed the W-compiler options -Wno-null-conversion and -Wno-unused-private-field for cflags and cxxflags.

This solved the problem with gem install mysql2 and bundle install

Reference: http://www.randomactsofsentience.com/2013/05/gem-install-mysql2-missing-mysqlh-on-os.html

这篇关于捆绑软件安装问题:缺少mysql.h的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆