gpt4 book ai didi

ruby 1.8.7 : Symbol not found Error

转载 作者:数据小太阳 更新时间:2023-10-29 07:17:14 26 4
gpt4 key购买 nike

刚刚在带有新 gem 集(使用 RVM)的机器上全新安装了 ruby​​ 1.8.7 REE 和 MRI,但是当我尝试使用 memprof 时,我得到了这个错误

$ gem install memprof
$ irb
>> require 'rubygems'
>> require 'memprof'
>> LoadError: dlopen(/Users/schneems/.rvm/gems/ruby-1.8.7-p352@test/gems/memprof-0.3.10/lib/memprof.bundle, 9): Symbol not found: __mh_bundle_header
Referenced from: /Users/schneems/.rvm/gems/ruby-1.8.7-p352@test/gems/memprof-0.3.10/lib/memprof.bundle
Expected in: flat namespace
in /Users/schneems/.rvm/gems/ruby-1.8.7-p352@test/gems/memprof-0.3.10/lib/memprof.bundle - /Users/schneems/.rvm/gems/ruby-1.8.7-p352@test/gems/memprof-0.3.10/lib/memprof.bundle
from /Users/schneems/.rvm/gems/ruby-1.8.7-p352@test/gems/memprof-0.3.10/lib/memprof.bundle
from /Users/schneems/.rvm/rubies/ruby-1.8.7-p352/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:59:in `require'
from (irb):2

错误是找不到符号:__mh_bundle_header。我的问题是:我需要做什么才能让我的系统找到这个符号,或者我还需要安装其他东西吗?欢迎任何调试建议。

最佳答案

这就是我为了让它在 Snow Leopard 上工作所做的:

cd ..../gems/memprof-0.3.10/ext/

编辑Makefile,搜索LD_SHARED=

改变自

LDSHARED = cc -arch x86_64 -dynamiclib -undefined suppress -flat_namespace

LDSHARED = cc -arch x86_64 -bundle -bundle_loader $(RUBY) -undefined suppress -flat_namespace

(用 -bundle 和 -bundleloader 选项替换了 -dynamiclib)

然后,

make install(创建 memprof.bundle 并将其复制到 memprof*/lib)

编辑:澄清一下,$(RUBY) 必须包含 ruby​​ 解释器(可执行文件)的完整路径名。在 RVM 下,Makefile 将它初始化为适当的解释器,因此上面的代码行没有问题。

关于 ruby 1.8.7 : Symbol not found Error,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7907855/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com