Sqlite-3 error while ROR application is running

When I try to run a Ruby on Rails application .... I encounter the following error

symbol search 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 what exactly the error is. can someone please help me this ......

+4
source share
4 answers

I had the same problem this morning after upgrading sqlite3-ruby to 1.3.0. A quick fix is ​​to remove 1.3.0 and ensure that 1.2.5 is installed:

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

The best option is to set the gem configuration 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 to really look safe, explicitly pull in 1.2.5:

 config.gem 'sqlite3-ruby', :lib => 'sqlite3', :version => '1.2.5' 
+11
source

If you block your gemfile for sqlite3-ruby, you will have problems running the application in the latest versions of Rails, because Rails wants to have a gem named "sqlite3". The real solution to this problem is to ensure that the .bundle file that creates the gem really references the correct sqlite3 libraries.

By default, sqlite3 gem will reference a nonexistent library in your / usr / lib. It is not right. What you need to do is set the matching options directly to your system and reinstall the sqlite3 stone, and you can easily do this using

 $bundle config 

Their manpage indicates what it does, but this is the command I need to do (I have my own installation of SQLite from my site, not through brew or macports).

 $bundle config build.sqlite3 --with-sqlite3-include=/usr/local/include --with-sqlite3-lib=/usr/local/lib 

This will always submit the correct parameters to the gem when you try to “install the package” and your gem is correctly created.

Please note that this problem is curious in that it will not appear on Ruby 1.9 - rbconfig seems to be updated and will improve library search. But when you are going to use 1.8 compatibility, use this package configuration and everything will be installed.

+1
source

I had the same problem 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 issue with the Rails console.

However, I still haven’t received the passenger launch app, but I'm still working on it.

0
source

Ruby Enterprise Edition automatically installs sqlite3 gems, and issue 1.3.0 seems to be a problem.

If your Rails application does not require sqlite3, try removing the gem and restarting the application.

 sudo gem uninstall sqlite3 
0
source

Source: https://habr.com/ru/post/1312055/


All Articles