【问题标题】:Error while installing ruby-1.8.7 on Fedora 15在 Fedora 15 上安装 ruby​​-1.8.7 时出错
【发布时间】:2011-05-26 06:17:29
【问题描述】:

使用 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

【问题讨论】:

  • rvm notes 的输出是什么?
  • 为什么要将 /opt/local/include 添加到包含路径中?你这样做了吗?
  • @Andy gist.github.com/992640 @noodl 我所做的只是rvm install ree-1.8.7-2011.03
  • 我确实安装了 rvm notes 中所需的所有软件包,除了 yum 找不到 iconv-devel
  • 小更新:在 callback.fun 中,最后两行是这样的:gist.github.com/992644 很明显,这段代码不知何故被切断了,但我不明白为什么。

标签: ruby rvm


【解决方案1】:

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

Reinier Balt 的回答也有效,在我的情况下,我必须使用 yum 安装系统范围的 ruby​​。

这就是我所做的:

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

【讨论】:

  • 我还需要:yum install gdbm.x86_64 gdbm-devel.x86_64,希望对大家有所帮助。
  • 这对我以 root 身份安装 rvm 很有用。我不需要 gdbm* 包。
  • 这对我有用,但我也必须 yum install ruby​​-devel
【解决方案2】:

我也看到了

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

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

(对 cbtable 重复)

不知何故,简单的红宝石mkcallback.rb > callback.func 不起作用

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

【讨论】:

  • 它在我的设置中不起作用(Fedora Core 15,rvm 以 root 身份安装,安装 ree)。 ruby 调用一直失败并显示以下消息:mkcallback.rb:6:in 'require': no such file to load -- dlconfig (LoadError) from mkcallback.rb:6
  • 您可能还会遇到:mkmf.rb 在 /usr/lib/ruby/ruby.h 找不到 ruby​​ 的头文件,此时需要安装 ruby​​-devel 包
【解决方案3】:

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

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

【讨论】:

  • 这是它的根本原因,也是正确的解决方案,不像我的 hack :)
  • 我在archlinux上。我下载了答案中提到的补丁并做了$ rvm install 1.8.7-p352 --patch /path/to/downloaded/patch.patch。它没有任何问题。
  • 我可以确认这个补丁可以在 Fedora 16 上运行。在尝试使用补丁安装之前,请确保运行 rvm cleanup all 删除所有陈旧的坏文件。
  • @csabahenk 你能发布具体的细节(比如补丁是什么,或者在哪里下载)?该网站要求我登录,即使我已经登录,但登录后它显示“您无权访问此页面。”。
  • @TylerCollier:至于补丁,很遗憾我没有存档,但是关于这个bug的讨论已经保存在谷歌群里,你可以在其中看到对问题的详细分析:@ 987654322@一旦明白了,修复1.8.7的mkmf.rb就很容易了。
【解决方案4】:

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

补丁: 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。

【讨论】:

  • 这个答案看起来很有希望,任何人都可以检查它的有效性,以便我可以奖励赏金吗?我实际上放弃了 Fedora 15 并安装了 Ubuntu,它运行良好。
  • 嘿,我不认为它会在 1 小时内完成,但感谢您的考虑 ;)
  • 补丁不起作用,但我按照补丁的说明修改了 ext/dl/depend 文件,现在可以正常工作了,谢谢
【解决方案5】:

来自 user865548 的补丁现在在 RVM 中可用(将是 1.9.1 或只是 rvm get head

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-08-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-05-05
    • 1970-01-01
    相关资源
    最近更新 更多