user923594
user923594

Reputation: 71

sqlite3_open_v2 error

after turnning on the server (rails s), getting error message when browsing to the remote link. then:

/usr/bin/ruby: symbol lookup error: /usr/lib/ruby/gems/1.9.1/gems/sqlite3-1.3.4/lib/sqlite3/sqlite3_native.so: undefined symbol: sqlite3_open_v2

tryed to install sqlite3 gem / downgrade and nothing solves it. what am i doing wrong?

Upvotes: 6

Views: 3464

Answers (3)

farhadf
farhadf

Reputation: 1978

FWIW, I had to first install sqlite3 because my existing version was too old, and then build sqlite3 gem while pointing to the correct libraries:

wget http://www.sqlite.org/sqlite-autoconf-3070701.tar.gz
tar -zxvf sqlite-autoconf-3070701.tar.gz
cd sqlite-autoconf-3070701
./configure
make && make install
gem install sqlite3  -- --with-sqlite3-include=/usr/local/include --with-sqlite3-lib=/usr/local/lib

Upvotes: 0

kwngo
kwngo

Reputation: 31

I had this problem too.

I resolved it this way :

mv /usr/lib/libsqlite3.so.0  /usr/lib/libsqlite3.so.0.back
gem install sqlite3 -- --with-sqlite3-include=/usr/local/include --with-sqlite3-lib=/usr/local/lib

Upvotes: 3

Mike K.
Mike K.

Reputation: 3789

I got this error this week, and resolved it by adding the path to the sqlite library to LD_LIBRARY_PATH:

This was the path

[/usr/local/lib]$ ls
... libsqlite3.a  libsqlite3.la  libsqlite3.so  libsqlite3.so.0  libsqlite3.so.0.8.6

And I added it in the profile:

LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/lib
export LD_LIBRARY_PATH

This resolved the issue for me.

Upvotes: 4

Related Questions