Linus Linus - 5 months ago 106
Ruby Question

lazy symbol binding failed

Using OS X Yosemite, for an existing Rails project I've installed ruby version 2.3.0 (using rbenv), installed bundler, bundled and rehashed. Now when I try to start the rails server, using bundle exec rails s, I'm getting the error below.

I'm not entirely sure what happened after installing ruby 2.3.0 because this actually happened some time ago and as I couldn't get it to work in time, I switched back for an older ruby version for now. I've been searching for a solution for quite some time now since then. Solutions to similar issues here and other sites didn't solve this problem. The maybe most obvious solution, as stated below, running

gem pristine --all
doesn't solve the problem. I really hope you can guide me through, thanks a lot!

-> bundle exec rails s
Ignoring binding_of_caller-0.7.2 because its extensions are not built. Try: gem pristine binding_of_caller --version 0.7.2
Ignoring byebug-9.0.5 because its extensions are not built. Try: gem pristine byebug --version 9.0.5
Ignoring debug_inspector-0.0.2 because its extensions are not built. Try: gem pristine debug_inspector --version 0.0.2
Ignoring pg-0.18.4 because its extensions are not built. Try: gem pristine pg --version 0.18.4
Ignoring puma-3.4.0 because its extensions are not built. Try: gem pristine puma --version 3.4.0
Ignoring sqlite3-1.3.11 because its extensions are not built. Try: gem pristine sqlite3 --version 1.3.11
Ignoring websocket-driver-0.6.4 because its extensions are not built. Try: gem pristine websocket-driver --version 0.6.4
dyld: lazy symbol binding failed: Symbol not found: _rb_data_object_alloc
Referenced from: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/pg-0.18.4/lib/pg_ext.bundle
Expected in: flat namespace

dyld: Symbol not found: _rb_data_object_alloc
Referenced from: /Users/nandersen/Projects/the-lunch/vendor/bundle/gems/pg-0.18.4/lib/pg_ext.bundle
Expected in: flat namespace


Update

This is an update for a suggestion from an answer. The following error is the same for all mentioned gems.

gem pristine binding_of_caller --version 0.7.2
ERROR: While executing gem ... (Gem::Exception)
Failed to find gems ["binding_of_caller"] = 0.7.2

Answer

As I've tried a lot to get rid of this error, I cannot exactly tell what eventually solved it - but on the way to the solution I found out that I maybe had installed rbenv via github pull as well as homebrew. Assuming that this could lead to not installed gems (under a specific ruby version) being claimed as installed, this seems like a possible explanation. After running rm -rf ~/.rbenv, while leaving the brew's rbenv version installed, cleared the "ignoring ... because its native...." hints while reinstalling the gems.