gpt4 book ai didi

Ruby 使用 rbenv 在 OSX Lion 上失败

转载 作者:数据小太阳 更新时间:2023-10-29 06:55:53 32 4
gpt4 key购买 nike

我一直在尝试在我的 Lion 机器 (OSX 10.7.3) 上安装 Ruby。

我安装了 rbenv 和 ruby​​-build,并试图在我的机器上安装 1.9.2-p290。这是安装失败的输出:

$ rbenv install 1.9.2-p290
Downloading http://pyyaml.org/download/libyaml/yaml-0.1.4.tar.gz...
Installing yaml-0.1.4...
Installed yaml-0.1.4 to /Users/CSC/.rbenv/versions/1.9.2-p290
Downloading http://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.tar.gz...
Installing ruby-1.9.2-p290...

BUILD FAILED

Inspect or clean up the working tree at /var/folders/vm/gcqcld015jx025m7qgtxvw0m0000gn/T/ruby-build.20120301140751.6239
Results logged to /var/folders/vm/gcqcld015jx025m7qgtxvw0m0000gn/T/ruby-build.20120301140751.6239.log

Last 10 log lines:
/usr/bin/gcc-4.2 -I. -I../../../.ext/include/x86_64-darwin11.3.0 -I../../.././include -I../../.././ext/racc/cparse -DRUBY_EXTCONF_H=\"extconf.h\" -I'/Users/SamCouch/.rbenv/versions/1.9.2-p290/include' -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -pipe -o cparse.o -c cparse.c
/usr/bin/gcc-4.2 -dynamic -bundle -o ../../../.ext/x86_64-darwin11.3.0/racc/cparse.bundle cparse.o -L. -L../../.. -L. -L'/Users/SamCouch/.rbenv/versions/1.9.2-p290/lib' -L/usr/local/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace -lpthread -ldl -lobjc
compiling readline
/usr/bin/gcc-4.2 -I. -I../../.ext/include/x86_64-darwin11.3.0 -I../.././include -I../.././ext/readline -DRUBY_EXTCONF_H=\"extconf.h\" -I'/Users/SamCouch/.rbenv/versions/1.9.2-p290/include' -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -pipe -o readline.o -c readline.c
readline.c: In function ‘username_completion_proc_call’:
readline.c:1386: error: ‘username_completion_function’ undeclared (first use in this function)
readline.c:1386: error: (Each undeclared identifier is reported only once
readline.c:1386: error: for each function it appears in.)
make[1]: *** [readline.o] Error 1
make: *** [mkmain.sh] Error 1

我试图解决这个问题,但到目前为止我还没有想出任何解决方案:

$ which gcc
/usr/bin/gcc
$ gcc
i686-apple-darwin11-llvm-gcc-4.2: no input files
$ ruby-build
ruby-build 20120216
usage: ruby-build [-v|--verbose] definition prefix
ruby-build --definitions

如有任何帮助,我们将不胜感激!

作为旁注,我已经尝试过此处发布的其他类似建议,但没有一个对我有用。

最佳答案

根据 ruby​​-build issue #130当前的解决方法是:


env CC=/usr/bin/gcc rbenv 安装 1.9.3-p125

我刚刚在一个系统上成功地测试了这个:

  • OS X 10.7.3
  • Xcode 4.3.1
  • 已安装 Xcode 命令行工具(通过 Xcode > 首选项 > 下载)
  • ruby-build @ fbfa944
  • rbenv @ 975b45d

此外,挂起的拉取请求 #137旨在一劳永逸地解决这个问题。

FWIW,自 Xcode 4.3.x 发布以来,很多人都在解决构建链问题。如果您已经升级到新的工具链,那么在集体尘埃落定之前,任何系统都会出现一些不稳定的情况。

关于Ruby 使用 rbenv 在 OSX Lion 上失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9525213/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com