【问题标题】:Trouble Installing Ruby 1.9.2 on OSX - Readline and Make errors在 OSX 上安装 Ruby 1.9.2 时遇到问题 - Readline 和 Make 错误
【发布时间】:2012-05-14 23:21:33
【问题描述】:

我不断收到这些错误:

运行“make”时出错,请阅读 /Users/jason*/.rvm/log/ruby-1.9.2-p320/make.log 运行 make 时出现错误。停止安装。 ls: /Users/jason*/.rvm/rubies/*/bin/ruby: 没有那个文件或目录

我已尝试安装 readline 并确保我拥有最新的 GCC 版本。 这是错误日志。

/usr/bin/gcc-4.2 -dynamic -bundle -o ../../../.ext/x86_64-darwin11.3.0/racc/cparse.bundle cparse.o -L. -L../../.. -L/Users/jasonvdm/.rvm/usr/lib -L. -L/usr/local/lib -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace  -lruby.1.9.1  -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/jasonvdm/.rvm/usr/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  -fno-common -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

【问题讨论】:

  • 你安装了 Xcode 和命令行工具吗?
  • 是的,我有 Xcode 和您注册为开发人员后获得的命令行工具。
  • 啊!有用!谢谢!
  • 我正在尝试再次安装以工作,这次是 1.9.2p180。你的修复没有出现,不知道为什么。帮忙?

标签: ruby-on-rails ruby error-handling makefile installation


【解决方案1】:

您是从源代码编译 Readline 吗?假设您的系统上至少有一个工作版本的 Ruby,通过 Homebrew 编译和安装 Readline 可能不会那么痛苦。

完成后,您可以再次尝试安装 Ruby 1.9.2 的 RVM,它应该会跳过 Readline 编译步骤。

根据评论更新:

所以您正在使用 Homebrew 安装的 Readline。在这种情况下,找出新的(较少损坏的)Readline 库的安装位置,并尝试将 那个 版本的 Readline 的位置传递给 RVM 安装过程。比如:

rvm 安装 ruby​​-1.9.2-p320 -C --with-readline-dir=/usr/local/Cellar/readline/6.2.1

显然,您的目录将与我的示例中的目录略有不同。

【讨论】:

  • 啊,原来如此。在这种情况下,我已经修改了我的答案以反映这条新信息;-)
  • 字,我试试看。谢谢。
  • Spotlight 找到两个 readline 文件夹,它们都在我的下载文件夹中的 ruby​​1.9.3 文件夹中。它是否正确?一个正在测试中,另一个正在分机中。
  • 如果您想使用 Homebrew readline,它将安装在 /usr/local/Cellar 下的某个位置 – 使用终端查看那里... Spotlight 不会索引这些隐藏的UNIX 目录,因此它不会显示在您计算机上的搜索结果中。
【解决方案2】:

如果您使用的是 RVM,请阅读this question and answers 中的过程。

你最好用rvm pkg命令安装readline库。

【讨论】:

    猜你喜欢
    • 2011-10-21
    • 2011-11-30
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-03-12
    • 1970-01-01
    • 2023-03-13
    • 1970-01-01
    相关资源
    最近更新 更多