Lee McAlilly
Lee McAlilly

Reputation: 9316

sqlite3 symbol not found when I run "rails server"

I'm not longer able to start my server. Have no idea what happened, but I'm getting this error when I run "rails s":

Core:pocketbook lee$ rails s
dyld: lazy symbol binding failed: Symbol not found: _sqlite3_initialize
  Referenced from: /Users/lee/Dropbox/Apps/pocketbook/ruby/1.9.1/gems/sqlite3-ruby-1.3.1/lib/sqlite3/sqlite3_native.bundle
  Expected in: flat namespace

dyld: Symbol not found: _sqlite3_initialize
  Referenced from: /Users/lee/Dropbox/Apps/pocketbook/ruby/1.9.1/gems/sqlite3-ruby-1.3.1/lib/sqlite3/sqlite3_native.bundle
  Expected in: flat namespace

It's weird though because I'm using ruby 1.9.2 with rvm. When I run "which ruby", it retruns ".rvm/rubies/ruby-1.9.2-head/bin/ruby"

Not sure what I could have done to cause this problem.

Upvotes: 1

Views: 2842

Answers (3)

Brandt Lareau
Brandt Lareau

Reputation: 26

I have seen this problem come up a few times one of the reason it could be cause this to happen is dew to the version of sqlite3 being the wrong version. Some times you can have the sqlite3-ruby gem installed but not be compatible with the sqlite version your running.

Make sure your sqlite3 version is higher then 3.6.16

To check just run sqlite3 -version and you will know. Simple solution is just to update the sqlite.

I had this error happen when I decided to remove any trace of mac ports and switch over to brew

Upvotes: 1

d1jhoni1b
d1jhoni1b

Reputation: 8025

you might also check your location pwd, check if you are at the right level (path)...sounds stupid but i just spen one hour trying to solve this and the only thing that changed was a path (palmface) everything was just fine

Upvotes: 0

Lee McAlilly
Lee McAlilly

Reputation: 9316

Ok, it appears that the latest version of sqlite3 doesn't work well with OS X Leopard. So, I had to specify the version of sqlite3 to use in my gemfile. I added this line:
gem 'sqlite3-ruby', '1.2.5', :require => 'sqlite3'

FYI to anyone else having these problems.

Upvotes: 3

Related Questions