Use Taps in JRuby

159 Views Asked by At

I am trying to running Taps in JRuby, but it always fail. It seems there's something wrong with the SQLite3:

taps server sqlite:///my-db.sqlite3 user passwd

/usr/bin/java: symbol lookup error: ~/.rvm/gems/jruby-1.6.7.2/gems/sqlite3-1.3.6/lib/sqlite3/sqlite3_native.so: undefined symbol: rb_check_safe_obj

Is there any body get stuck in this like me?

Thanks.

1

There are 1 best solutions below

0
On

After hours of searching and looking through the code of Taps, I found the answer myself :D. The problem is native SQLite in JRuby is a madness, we must use JDBC instead.

export TAPS_DATABASE_URL="jdbc:sqlite:///tmp/taps.db.2012-08-07"
taps server jdbc:sqlite:///my-db.sqlite3 user passwd

The first command is to prevent Taps from creating it internal DB with native sqlite connection. Taps will use ENV['TAPS_DATABASE_URL']. In the second command, we must add a prefix 'jdbc:' to instruct Taps (actually Taps use Sequel) connect to DB with JDBC adapter.