简体   繁体   English

在OSX 10.6.3上安装mysql ruby​​ gem时出错

[英]error when installing mysql ruby gem on OSX 10.6.3

So I am getting the same issue as mentioned here - gem install mysql failure in Snow Leopard 所以我遇到了这里提到的相同问题-Snow Leopard中的gem install mysql failure

But I haven't been able to get it fixed using the answers on this link. 但是我无法使用此链接上的答案来修复它。

Here's a brief history - 这是一段简短的历史-

  • I had MAMP on my machine, 我的机器上装有MAMP,
  • but now I downloaded the latest MySQL from mysql.com and installed version 5.1.46 但是现在我从mysql.com下载了最新的MySQL并安装了版本5.1.46
  • this new version runs fine and client "mysql" is able to connect 这个新版本运行良好,客户端“ mysql”能够连接
  • and I also have XCode v3.2.1, since someone mentioned that it can cause issues. 我还拥有XCode v3.2.1,因为有人提到它会引起问题。

Here's the error - 这是错误-

**Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
    ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb --with-mysql-config=/usr/local/mysql/bin/mysql_config
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/ruby.h
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out**

"can't find header files for ruby" usually means that the system can't locate the header files for Ruby. “找不到Ruby的头文件”通常意味着系统无法找到Ruby的头文件。 This happened to me when I upgraded to 10.6 from 10.5. 当我从10.5升级到10.6时,这发生在我身上。 Download the latest XCode from Apple's site and reinstall it. 从Apple网站下载最新的XCode,然后重新安装。 Make sure that you check the box for "UNIX Development" during the install. 确保在安装过程中选中“ UNIX开发”框。 The header files for Ruby are not in the main package. Ruby的头文件不在主包中。

Have you installed other versions of Ruby or are you using the standard 1.8.7 that comes with OS X? 您是否安装了其他版本的Ruby,或者您使用的是OS X随附的标准1.8.7? You can check your version of ruby by typing ruby -v at a terminal prompt. 您可以通过在终端提示符下键入ruby -v来检查您的ruby版本。

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

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