mysql.h缺少....(Ruby on Rails,OSX) [英] mysql.h is missing .... (Ruby on Rails, OSX)

查看:72
本文介绍了mysql.h缺少....(Ruby on Rails,OSX)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了几个想法......他们都没有工作......
我只是试图安装mysql2作为宝石。我的MySQL正在工作,但每当我的系统说,那个mysql.h丢失...有人有一个想法?现在非常令人沮丧... ...

我使用的是osx 10.8.3,ruby 1.9.3,rails 3.2.13和home-brew。

  gem install mysql2 -v'0.3.11'
构建原生扩展。这可能需要一段时间...
错误:安装mysql2时出错:
错误:无法构建gem本机扩展。

/Users/gadreel/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
检查rb_thread_blocking_region()...是
检查对于rb_wait_for_single_fd()...是
检查mysql.h ...否
检查mysql / mysql.h ...否
-----
mysql .h缺失。请检查你的mysql安装并重试。
-----
*** extconf.rb失败***
由于某种原因无法创建Makefile,可能缺少
必需的库和/或头文件。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。

提供的配置选项:
--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 = / Users / gadreel / .rvm / rubies / ruby​​-1.9.3 -p429 / bin / ruby​​
--with-mysql-config
--without-mysql-config

文件`哪个mysql`
/ usr / local / mysql / bin / mysql:Mach-O 64位可执行文件x86_64
code>


解决方案

使用像自制程序 MacPorts 使其相当直观,向前解决这个问题。从Oracle直接获得的MySQL的二进制分发以及与OS X捆绑在一起的MySQL的二进制分发没有开发头,其中 mysql.h 就是其中之一。



Homebrew会像这样修复它:

  brew install mysql 

MacPorts非常类似:

  sudo port install mysql 

这两个安装库,一个命令行客户端和关联这些库的开发标头。启用服务器是可选的。



另外,您可以获取源代码直接从苹果公司购买并安装它。

去。


I tried several ideas ... none of them worked ... I'm just trying to install mysql2 as a gem. My mysql is working, but every time my system says, that mysql.h is missing ... Has someone an idea? It's very frustrating now ...

I'm using osx 10.8.3, ruby 1.9.3, rails 3.2.13 and home-brew.

    gem install mysql2 -v '0.3.11'
Building native extensions.  This could take a while...
ERROR:  Error installing mysql2:
    ERROR: Failed to build gem native extension.

        /Users/gadreel/.rvm/rubies/ruby-1.9.3-p429/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... 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
    --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/gadreel/.rvm/rubies/ruby-1.9.3-p429/bin/ruby
    --with-mysql-config
    --without-mysql-config

    file `which mysql`
    /usr/local/mysql/bin/mysql: Mach-O 64-bit executable x86_64

解决方案

Using a package manager like Homebrew or MacPorts makes it fairly straight-forward to fix this. The binary distribution of MySQL direct from Oracle and the one bundled with OS X itself does not have the development headers, of which mysql.h is one of them.

Homebrew would fix it like this:

brew install mysql

MacPorts is very similar:

sudo port install mysql

Both of these install libraries, a command-line client and the associated development headers for the libraries. Enabling the server is optional.

As an alternative, you can get the source direct from Apple and install it whatever way you see fit.

Generally Homebrew is the best way to go.

这篇关于mysql.h缺少....(Ruby on Rails,OSX)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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