无法编译ruby 1.9.3 [英] Cannot compile ruby 1.9.3

查看:266
本文介绍了无法编译ruby 1.9.3的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我执行

rvm install 1.9.3 --with-gcc=clang

在Mac OSX Lion,ruby不编译,我得到以下错误在(.rvm / log / ruby​​-1.9.3- p374 / make.log)

on Mac OSX Lion, ruby does not compile, and I get the following error in (.rvm/log/ruby-1.9.3-p374/make.log)

[2013-01-29 16:31:05] 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/will/.rvm/usr/include -I. -I.ext/include/x86_64-darwin12.2.1 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -Wl,-flat_namespace  
SOLIBS = 
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

如何获得ruby 1.9.3在Lion上安装

How can I get ruby 1.9.3 to install on Lion?

推荐答案

您正在使用 clang ,根据这张票 http://bugs.ruby-lang.org/issues/5883 - 它不是完全支持 - 你需要尝试使用 gcc-4.2 ,你会得到说明为homebrew与运行 rvm要求

you are using clang, according to this ticket http://bugs.ruby-lang.org/issues/5883 - it's not "fully" supported - you need to try using gcc-4.2, you get instructions for homebrew with running rvm requirements.

这里是这个问题的RVM票证 https://github.com/wayneeseguin/rvm/issues/1480

here is RVM ticket for this problem https://github.com/wayneeseguin/rvm/issues/1480

更新:Ruby-2.0.0实际上与 clang 然后使用 gcc-4.2 ,更多详细信息: http://stackoverflow.com/a/15655034/497756

UPDATE: Ruby-2.0.0 actually compiles better with clang then with gcc-4.2, more details here: http://stackoverflow.com/a/15655034/497756

这篇关于无法编译ruby 1.9.3的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆