【问题标题】:MySQL "unrecognized command line option '-aes'" with ruby 1.9.3-p125?MySQL“无法识别的命令行选项'-aes'”与ruby 1.9.3-p125?
【发布时间】:2012-03-17 12:40:30
【问题描述】:

我最近在 Mac OS X 上安装了 ruby​​ 1.9.3-p125。我将 rvm 用于 ruby​​ mgmt,将 homebrew 用于 mysql 等。

奇怪的是,我在 p125 上遇到了一个奇怪的问题,在 p0 上似乎根本没有发生,并希望对这里可能发生的事情有所了解:

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

        /Users/username/.rvm/rubies/ruby-1.9.3-p125/bin/ruby extconf.rb
checking for rb_thread_blocking_region()... yes
checking for rb_wait_for_single_fd()... yes
checking for mysql.h... yes
checking for errmsg.h... yes
checking for mysqld_error.h... yes
creating Makefile

make
compiling result.c
cc1: error: unrecognized command line option "-aes"
make: *** [result.o] Error 1


Gem files will remain installed in /Users/username/.rvm/gems/ruby-1.9.3-p125@all/gems/mysql2-0.3.11 for inspection.
Results logged to /Users/username/.rvm/gems/ruby-1.9.3-p125@all/gems/mysql2-0.3.11/ext/mysql2/gem_make.out

奇怪的是,如果我卸载 mysql 并重新安装它,然后构建 gem,它似乎可以工作......但只有在每次都非常努力之后。

澄清一下,Xcode 4.3 已安装并且构建环境看起来完全正常。如果我从 mysql2 Makefile 中删除-aes,它将构建和安装得很好,所以由于某种原因,这似乎是 ruby​​ 1.9.3-p125、mysql2 以及新的 Xcode 4.3 的组合效果...

【问题讨论】:

  • 我刚刚从mysql2 开发人员那里收到了有趣的评论:“我实际上刚刚有一个同事遇到了同样的错误。甚至不知道 -aes 选项来自哪里。绝对让我知道你是否追踪到了什么。” link to issue
  • 现已解决。问题原讨论:github.com/mxcl/homebrew/issues/10549#issuecomment-4208528 ----------------------------------------- -------------------------------------------

标签: mysql ruby-on-rails ruby gem homebrew


【解决方案1】:

看起来您没有使用 cc 而不是 gcc 进行编译。请确保已安装 Xcode。在此处阅读更多信息Mac OSX : python packages failed to build because of gcc issues

【讨论】:

  • 不幸的是,它已经全部安装好了,环境也很健全。我遇到的唯一问题是 mysql2 Makefile 中的 -aes 无法构建 gem。但是,如果它存在,mysql2 不会构建。
猜你喜欢
  • 2021-08-21
  • 2021-01-28
  • 2021-08-05
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2015-04-01
  • 2020-10-06
相关资源
最近更新 更多