Ruby 1.8.7: Symbol not found Error

I just made a new installation of ruby โ€‹โ€‹1.8.7 REE and MRI on a machine with fresh gem sets (using RVM). However, in each of them, when I try to use memprof, I get this error

$ 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

The error Symbol not found: __mh_bundle_header. My question is: what do I need to do to get my system to find this character, or is there something else I need to install? Any debugging suggestions are welcome.

+5
source share
2 answers

This is what I did to make it work on Snow Leopard:

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

Edit Makefile, find LD_SHARED =

Change

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

to

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

(replaced by -dynamiclib with the -bundle and -bundleloader options)

Then

make install ( memprof.bundle memprof */lib)

: , $(RUBY) ruby โ€‹โ€‹( ). RVM Makefile , .

+3

, . LDFLAGS="-bundle"... , RVM, , , .

| , , ld : LDFLAGS="-bundler_loader" EDIT 2 | , , bundle bundle_loader... Google.

+1

All Articles