tags:

views:

813

answers:

3

Hi When i try to run Ruby on Rails application.... i facing the following error

symbol lookup error: /home/user/.rvm/gems/ruby-1.9.2-preview3/gems/sqlite3-ruby-1.3.0/lib/sqlite3/sqlite3_native.so: undefined symbol: sqlite3_initialize

I don't know whats the error exactly. can any one please help me out this......

A: 

I'm had the same issue on my Dreamhost server:

> bundle exec rails c 
ruby: symbol lookup error: /home/user/settings/installs/rubygems/gems/gems/sqlite3-ruby-1.3.0/lib/sqlite3/sqlite3_native.so: undefined symbol: sqlite3_initialize

I downloaded and installed SQLite3 manually in my home directory, and added LD_LIBRARY_PATH to my .bashrc. This fixed the Rails console issue.

However, I still haven't gotten the app to launch in passenger yet, I'm still working on it.

Mike De La Loza
+6  A: 

I had the same issue this morning after upgrading sqlite3-ruby to 1.3.0. A quick fix is to uninstall 1.3.0 and ensure 1.2.5 is installed:

gem uninstall sqlite3-ruby --version 1.3.0
gem install sqlite3-ruby --version 1.2.5

The better option is to set your gem config to ignore 1.3.0. For Rails 2.x, in config/environment.rb:

config.gem 'sqlite3-ruby', :lib => 'sqlite3', :version => '!= 1.3.0'

or if you want it play it really safe, explicitly pull in 1.2.5:

config.gem 'sqlite3-ruby', :lib => 'sqlite3', :version => '1.2.5'
Jason Weathered
Thanks Jason .... its really helped me to come out from the heart breaking error..........
palani
A: 

Ruby Enterprise Edition installs the sqlite3 gem automatically, and 1.3.0 seems to be the problem.

If your Rails app doesn't need sqlite3, try uninstalling the gem and restarting your app.

sudo gem uninstall sqlite3
Steve Madsen