Skip to content

Instantly share code, notes, and snippets.

@takuyan
Created January 4, 2016 13:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takuyan/8be0b9ed7a5e5d1f6fc9 to your computer and use it in GitHub Desktop.
Save takuyan/8be0b9ed7a5e5d1f6fc9 to your computer and use it in GitHub Desktop.
ruby error on rails s
$ r s
dyld: lazy symbol binding failed: Symbol not found: _rb_data_object_alloc
Referenced from: /Users/takuyan/dev/github/scrum/vendor/bundle/gems/nokogiri-1.6.6.2/lib/nokogiri/nokogiri.bundle
Expected in: flat namespace
dyld: Symbol not found: _rb_data_object_alloc
Referenced from: /Users/takuyan/dev/github/scrum/vendor/bundle/gems/nokogiri-1.6.6.2/lib/nokogiri/nokogiri.bundle
Expected in: flat namespace
[1] 30819 trace trap rails s
@takuyan
Copy link
Author

takuyan commented Jan 4, 2016

dyld: lazy symbol binding failed: Symbol not found: _rb_data_typed_object_alloc
  Referenced from: /Users/takuyan/dev/github/scrum/vendor/bundle/gems/debug_inspector-0.0.2/lib/debug_inspector.bundle
  Expected in: flat namespace

@eliotsykes
Copy link

For fellow devs arriving here after searching for dyld: Symbol not found: _rb_data_object_alloc:

  1. Check your ruby version ruby -v for the project you're trying to run is the one you intended.
  2. You may want to create a .ruby-version file for rbenv/rvm in the project root to set the version. After creating .ruby-version, Check that ruby -v gives the version you expect.
  3. Try whatever command (e.g. bundle exec rails s, bundle exec rspec) that gave the original error ensuring that it is run with the bundle deps (use bundle exec ...). Hopefully the error has gone.
  4. If you still get the dyld: Symbol not found: _rb_data_object_alloc error, rebuild all the bundled gems with extensions from scratch for the current ruby version. This can be done by running bundle exec gem pristine inside the project root.

@mhulet
Copy link

mhulet commented Nov 9, 2016

On my side, I also had to:

  1. delete everything under vendor/bundle directory: rm -Rf vendor/bundle/*
  2. run bundle install

@assafshomer
Copy link

yes, also for me, delete the .bundle dir and rebundle fixed it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment