ruby-on-rails - 在 OSX 上安装 Ruby 1.9.2 时遇到问题 - Readline 和 Make 错误

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

我不断收到这些错误:

运行“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

最佳答案

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

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

根据评论更新:

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

rvm install ruby-1.9.2-p320 -C --with-readline-dir=/usr/local/Cellar/readline/6.2.1

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

关于ruby-on-rails - 在 OSX 上安装 Ruby 1.9.2 时遇到问题 - Readline 和 Make 错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10592291/

相关文章:

ruby-on-rails - Rails rabl - 返回所有属性,而不仅仅是命名属性

javascript - Rails 4 Turbolinks 使表单提交多次

mysql - acts_as_api 和项目符号 N+1 查询

mysql - mysql版本变更会影响迁移吗?

ruby-on-rails - Rails — 带有 "dot"的参数(例如/google.com)

python - 为什么 "except: pass"是一种糟糕的编程习惯?

ruby-on-rails - "text-search query doesn' t包含词素:"mean?

ruby-on-rails - ActiveAdmin 存在 has_many 问题;未定义的方法 'new_record?'

reactjs - React,Redux-Saga : Which is the best way to handle error in saga and inform component to display that error

php - 我无法将 Sentry 添加到php slim