在Fedora 15上安装ruby-1.8.7时出错

时间:2011-05-26 06:17:30

标签: ruby rvm

使用RVM,我尝试在安装Fedora 15后安装ree-1.8.7-2011.03,我收到以下错误。在Ubuntu 11.04上使用rvm install ree-1.8.7-2011.03可以正常工作..

与Fedora 15上的MRI ruby​​-1.8.7-p334相同的错误(和解决方案)。

关于如何解决此问题的任何想法?

make[1]: Entering directory `/home/ryguy/.rvm/src/ree-1.8.7-2011.03/source/ext/dl'
gcc -I/opt/local/include -I. -I/opt/local/include -I../.. -I../../. -I../.././ext/dl -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_DLCLOSE -DHAVE_DLSYM -DHAVE_DLERROR    -I. -fPIC -g -O2   -fno-defer-pop -fno-omit-frame-pointer  -c ptr.c
gcc -I/opt/local/include -I. -I/opt/local/include -I../.. -I../../. -I../.././ext/dl -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_DLCLOSE -DHAVE_DLSYM -DHAVE_DLERROR    -I. -fPIC -g -O2   -fno-defer-pop -fno-omit-frame-pointer  -c handle.c
Generating callback.func
Generating cbtable.func
gcc -I/opt/local/include -I. -I/opt/local/include -I../.. -I../../. -I../.././ext/dl -DHAVE_DLFCN_H -DHAVE_DLOPEN -DHAVE_DLCLOSE -DHAVE_DLSYM -DHAVE_DLERROR    -I. -fPIC -g -O2   -fno-defer-pop -fno-omit-frame-pointer  -c dl.c
In file included from dl.c:104:0:
callback.func:1:1: warning: data definition has no type or storage class [enabled by default]
callback.func:1:7: error: expected identifier or ‘(’ before ‘long’
In file included from dl.c:104:0:
callback.func:78:33: error: expected ‘)’ before ‘(’ token
callback.func:79:3: warning: data definition has no type or storage class [enabled by default]
callback.func:79:24: error: ‘proc’ undeclared here (not in a function)
callback.func:79:39: error: ‘argc’ undeclared here (not in a function)
callback.func:79:45: error: ‘argv’ undeclared here (not in a function)
callback.func:82:1: error: expected identifier or ‘(’ before ‘}’ token
dl.c:106:1: error: expected ‘;’, ‘,’ or ‘)’ before ‘static’
make[1]: *** [dl.o] Error 1
make[1]: Leaving directory `/home/ryguy/.rvm/src/ree-1.8.7-2011.03/source/ext/dl'
make: *** [all] Error 1

5 个答案:

答案 0 :(得分:28)

在Fedora 15中使用rvm安装ruby-1.8.7时也会发生这种情况。

Reinier Balt的回答也有效,在我的情况下,我不得不使用yum安装系统级的红宝石。

这就是我的所作所为:

cd ~/.rvm/src/ruby-1.8.7-p334/ext/dl
ruby mkcallback.rb > callback.func
ruby mkcbtable.rb > cbtable.func

答案 1 :(得分:14)

我也看到了这个

我进入了src / ext / dl目录并手动生成了callback.func和cbtable.func,它们都是不完整的。我不得不做

rm callback.func
touch callback.func
ruby mkcallback.rb >> callback.func

(重复cbtable)

不知何故,简单的ruby mkcallback.rb > callback.func无效

然后重新运行rvm install 1.8.7,不会覆盖您的更改。

答案 2 :(得分:14)

https://bugs.ruby-lang.org/issues/5108

[[tl; dr:见底部补丁]]

答案 3 :(得分:3)

我不知道为什么会发生这种情况,但似乎重定向到文件并不会完全重定向输出。作为一个临时的黑客/修复,确实可以使它工作,你可以通过发球台管道。它完成了工作,但肯定不是正确的解决方案。

修补 https://gist.github.com/1083163

此修补程序如此应用:rvm install --patch /path/to/Fedora-15-ruby-1.8.7-p352.patch%0 ruby-1.8.7将起作用。我也会用ree测试它并更新。

编辑:这个补丁也适用于ree。

rvm install --patch /path/to/Fedora-15-ruby-1.8.76-p352.patch%0 ree为我成功安装了一个工作ree。

答案 4 :(得分:0)

来自user865548的

补丁现在可在RVM中使用(将1.9.1或仅rvm get head

相关问题