Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RVM ruby 1.9.2 Symbol not found: _STR2CSTR

Troubleshooting RVM.

Installed both Ruby 1.9.2-Head / 1.9.2-p136

When running the server, server crashes receiving this error:

dyld: lazy symbol binding failed: Symbol not found: _STR2CSTR
Expected in: flat namespace

dyld: Symbol not found: _STR2CSTR
Expected in: flat namespace

Found this posting but didn't help much: http://www.ruby-forum.com/topic/215406

Any solutions would be great!

like image 407
user567604 Avatar asked Jan 07 '11 23:01

user567604


2 Answers

I was having the same problem with Ruby 1.9.2 and the sqlite-ruby-1.2.4 gem, which is somehow required by Rails 3.0.3. This was my error message:

dyld: Symbol not found: _STR2CSTR
  Referenced from: ~/.rvm/gems/ruby-1.9.2-p136/gems/sqlite3-ruby-1.2.4/lib/sqlite3_api.bundle
Expected in: flat namespace

And I was able to fix it by going to ~/.rvm/gems/ruby-1.9.2-p136/gems/sqlite3-ruby-1.2.4/ext where the source code for the sqlite3_api.bundle was located, and replacing every occurrence of STR2CSTR by StringValuePtr as described here (first reply). I then recompiled (using make) and copied the resulting sqlite3_api.bundle to the lib/ folder.

like image 168
fresskoma Avatar answered Oct 22 '22 20:10

fresskoma


I updated my sqlite3-ruby gem to sqlite3 Just change (in your Gemfile)

gem 'sqlite3-ruby', :require => 'sqlite3'

to

gem 'sqlite3', :require => 'sqlite3'

and run

bundle install
like image 20
Pierre Valade Avatar answered Oct 22 '22 20:10

Pierre Valade