【问题标题】:RVM Ruby 1.9.3 Errors in Mac 10.8.2Mac 10.8.2 中的 RVM Ruby 1.9.3 错误
【发布时间】:2013-02-18 23:05:59
【问题描述】:

我正在尝试在 Mountain Lion 中使用 RVM 安装 Ruby,并在运行 make 时不断出错,即使我使用 gcc=clang 这样做也是如此(其他帖子中推荐的解决方案)。我已经安装了命令行实用程序更新了 XCode。

make.log 读取

    [2013-02-18 17:37:00] make
    CC = clang
    LD = ld
    LDSHARED = clang -dynamic -bundle
    CFLAGS = -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Werror=pointer-arith -Werror=write-strings -Werror=declaration-after-statement -Werror=shorten-64-to-32 -Werror=implicit-function-declaration  -pipe 
    XCFLAGS = -include ruby/config.h -include ruby/missing.h -fvisibility=hidden -DRUBY_EXPORT
    CPPFLAGS = -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE   -I/Users/maraaverick/.rvm/usr/include -I. -I.ext/include/x86_64-darwin12.2.0 -I./include -I.
    DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace  
    SOLIBS = 
compiling main.c
compiling dmydln.c
compiling dmyencoding.c
compiling version.c
compiling dmyversion.c
compiling miniprelude.c
compiling array.c
compiling bignum.c
bignum.c:2732:26: warning: while loop has empty body [-Wempty-body]
        while (--ny && !zds[ny]); ++ny;
                                ^
bignum.c:2732:26: note: put the semicolon on a separate line to silence this warning
1 warning generated.
compiling class.c
compiling compar.c
compiling complex.c
compiling dir.c
compiling dln_find.c
compiling enum.c
compiling enumerator.c
compiling error.c
compiling eval.c
compiling load.c
compiling proc.c
compiling file.c
compiling gc.c
gc.c:3060:1: warning: unused function 'chain_finalized_object' [-Wunused-function]
chain_finalized_object(st_data_t key, st_data_t val, st_data_t arg)
^
1 warning generated.
compiling hash.c
compiling inits.c
compiling io.c
compiling marshal.c
compiling math.c
compiling node.c
compiling numeric.c
compiling object.c
compiling pack.c
compiling parse.c
compiling process.c
compiling random.c
compiling range.c
compiling rational.c
compiling re.c
compiling regcomp.c
compiling regenc.c
compiling regerror.c
compiling regexec.c
compiling regparse.c
regparse.c:582:15: error: implicit conversion loses integer precision: 'st_index_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
    return t->num_entries;
    ~~~~~~ ~~~^~~~~~~~~~~
1 error generated.
make: *** [regparse.o] Error 1

当我没有指定 gcc 时也是如此,当我尝试按照建议 here 使用 openssl 和独立 gcc 包进行安装时

rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr

虽然当我尝试指定我的本地 gcc 时,我被告知它不在我的路径中:

$ CC=/opt/local/bin/gcc-apple-4.2 rvm install ruby-1.9.3-p194 --enable-shared --without-tk --without-tcl
You requested building with '/opt/local/bin/gcc-apple-4.2' but it is not in your path.

任何帮助将不胜感激。非常感谢。

【问题讨论】:

  • 你确定你安装了 GCC 吗?我想我有同样的问题,重新安装 GCC 有帮助
  • Cannot compile ruby 1.9.3的可能重复
  • @IlyaCherevkov 我安装了 GCC,但它没有链接 brew install apple-gcc42 错误:apple-gcc42-4.2.1-5666.3 已经安装,只是没有链接'这可能是问题吗?如果是这样-有关链接的任何建议-我不确定如何
  • @mpapis 我尝试了该线程中的方法,但无法让它们中的任何一个为我工作(我已经运行了自制方法,但由于某种原因无法让我的 gcc '链接') - 我不知道什么论坛礼仪什么重新。将我自己的问题添加到该线程的底部 - 如果我以错误的方式处理它,我们深表歉意 - 感谢您提供链接!

标签: ruby macos rvm


【解决方案1】:

您使用的是clang,这里是对问题的更好解释https://stackoverflow.com/a/14594287/497756,这里是改进的过程(还没有在rvm头上):https://stackoverflow.com/a/14940278/497756

【讨论】:

  • 当我运行它'--with-gcc=gcc-4.2'我仍然得到make错误然后我尝试了新的实验方法(使用rvm get分支)并导致(不得不删除一些长度代码)'... 将 Homebrew 从 c98d5049 更新为 e94eb707。 ==> 更新公式 bochs mapserver 节点 stunnel texmacs 厕所 tuntap 安装所需的软件包:libxml2、libxslt、libksba、curl-ca-bundle。运行“requirements_brew_libs_install libxml2 libxslt libksba curl-ca-bundle”时出错,请阅读/Users/maraaverick/.rvm/log/ruby-1.9.3-p385/package_install_libxml2_libxslt_libksba_curl-ca-bundle.log'
  • 请创建一个gist的命令和错误日志并打开一个ticket for RVM
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2012-02-07
  • 1970-01-01
  • 1970-01-01
  • 2012-07-23
  • 1970-01-01
  • 2012-02-28
相关资源
最近更新 更多