0

I am leveraging sqlite3 and active-record. On my local machine everything works as expected. However, when attempting to read from the database on a new debian deployment i get the following error :

ruby: symbol lookup error: /home/<redacted>/.rvm/gems/ruby-3.0.0/gems/sqlite3-1.3.13/lib/sqlite3/sqlite3_native.so: undefined symbol: rb_check_safe_obj

I have installed libsqlite3-dev and sqlite3 gem using

$ gem install sqlite3 -v 1.3.13 -- --with-sqlite3-include=/usr/include --with-sqlite3-lib=/usr/lib/arm-linux-gnueabihf/

What did I do wrong?

diedthreetimes
  • 4,086
  • 26
  • 38

1 Answers1

1

It looks like sqlite3 version 1.3.13 is not compatible with ruby 3.0.0.

Installing ruby version 2.5.1 resolved the issue.

$ rvm install 2.5.1
$ rvm use 2.5.1
$ gem install bundler
$ gem install sqlite3 -v 1.3.13 -- --with-sqlite3-include=/usr/include --with-sqlite3-lib=/usr/lib/arm-linux-gnueabihf/
$ bundle install
Williams
  • 4,044
  • 1
  • 37
  • 53
diedthreetimes
  • 4,086
  • 26
  • 38
  • They've since fixed this bug and you no longer need to downgrade rails: You can update sqlite3 to 1.4.2 or higher. See [this issue](https://github.com/sparklemotion/sqlite3-ruby/issues/307) on the sqlite3-ruby repo. – dannit Jun 14 '22 at 14:16