Just did a fresh install of ruby 1.8.7 REE and MRI on a machine with fresh gem sets (Using RVM) Yet 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 is Symbol not found: __mh_bundle_header
. My question is this: what do i need to do to get my system to find this symbol, or is there something else I need to install? Any debugging suggestions welcomed.
Looks like it was not compiled correctly and was missing the linker flags for the bundle library. Try building it was
LDFLAGS="-bundle"
... I'm not sure how you do that with RVM, but I assume it will inherit the environment you give it.EDIT | Sorry, looks like the correct ld flag may be:
LDFLAGS="-bundler_loader"
EDIT 2 | Actually, I'm not sure if it'sbundle
orbundle_loader
... I'm seeing both in Google results.