Error : 'incompatible library version' sql

2020-03-24 04:48发布

问题:

I working on Ubuntu system(16.04).

My problem is whenever i setup any rails project and try to run rails s then i got 'incompatible library version' error for sqlite3 something like below.

/home/jiggs/.rvm/gems/ruby-2.3.1@albumriver/gems/activesupport-4.0.0/lib/active_support/values/time_zone.rb:282: warning: circular argument reference - now
/home/jiggs/.rvm/gems/ruby-2.3.1@albumriver/gems/sqlite3-1.3.11/lib/sqlite3.rb:6:in `require': incompatible library version - /home/jiggs/.rvm/gems/ruby-2.3.1@albumriver/gems/sqlite3-1.3.11/lib/sqlite3/sqlite3_native.so (LoadError)
    from /home/jiggs/.rvm/gems/ruby-2.3.1@albumriver/gems/sqlite3-1.3.11/lib/sqlite3.rb:6:in `rescue in <top (required)>'
    from /home/jiggs/.rvm/gems/ruby-2.3.1@albumriver/gems/sqlite3-1.3.11/lib/sqlite3.rb:2:in `<top (required)>'
    from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:77:in `require'
    from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:77:in `block (2 levels) in require'
    from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:72:in `each'
    from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:72:in `block in require'
    from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:61:in `each'
    from /usr/lib/ruby/vendor_ruby/bundler/runtime.rb:61:in `require'
    from /usr/lib/ruby/vendor_ruby/bundler.rb:99:in `require'
    from /home/jiggs/sites/albumriverfinal/config/application.rb:7:in `<top (required)>'
    from /home/jiggs/.rvm/gems/ruby-2.3.1@albumriver/gems/railties-4.0.0/lib/rails/commands.rb:76:in `require'
    from /home/jiggs/.rvm/gems/ruby-2.3.1@albumriver/gems/railties-4.0.0/lib/rails/commands.rb:76:in `block in <top (required)>'
    from /home/jiggs/.rvm/gems/ruby-2.3.1@albumriver/gems/railties-4.0.0/lib/rails/commands.rb:73:in `tap'
    from /home/jiggs/.rvm/gems/ruby-2.3.1@albumriver/gems/railties-4.0.0/lib/rails/commands.rb:73:in `<top (required)>'
    from bin/rails:4:in `require'
    from bin/rails:4:in `<main>'

Rails version : 4.0.0

ruby version i tried with rails 4.0.0 :

  • ruby-2.0.0-p247 [ x86_64 ]

  • ruby-2.2.5 [ x86_64 ]

  • ruby-2.3.0 [ x86_64 ]

  • ruby-2.3.0-preview1 [ x86_64 ]

  • ruby-2.3.1 [ x86_64 ]

I trying to uninstall sqlite3 using gem uninstall sqlite3 and trying to run bundle install but got this error :

An error occurred while installing sqlite3 (1.3.11), and Bundler cannot continue.
Make sure that `gem install sqlite3 -v '1.3.11'` succeeds before bundling.

Then i run gem install sqlite3 -v '1.3.11' and run rails server and got same error again incompatible library version.

Output of sqlite3 gem install :

gem install sqlite3 -v '1.3.11'
Fetching: sqlite3-1.3.11.gem (100%)
Building native extensions.  This could take a while...
Successfully installed sqlite3-1.3.11
Parsing documentation for sqlite3-1.3.11
Installing ri documentation for sqlite3-1.3.11
Done installing documentation for sqlite3 after 1 seconds
1 gem installed

回答1:

The SQLite library is likely to be corrupted. Try reinstalling the gem by running the following from a command pronpt:

gem uninstall sqlite3

Then run:

bundle install


回答2:

I've rolled back ruby version to 2.3.0 and all worked .It seems to be an issue



回答3:

@Jiggs: The same issue I got when my system updated to 16.04. After that all previous applications were difficult to configure as throwing so many dependency errors, in which your error was one of them.

After lots of finding only conclusion I got the problem is on RVM,

If you are using RVM then please install Rails 5.0 in yous default gemset

rvm gemset use default
gem install rails -v=5.0 

After installing rails 5 all the compatible dependencies get installed.

Now move to your any project CREATE New GEMSET (please don't use previous).

rvm gemset create my_new_gemset
rvm gemset use my_new_gemset

Finally do bundle install

In my case after doing this resolved all the errors as you mentioned.

I know it is bit strange that installing Rails-5 in default gemset and using new gemset resolved this issue. But somehow it works.

Hope this will help you.



回答4:

For me going back to ruby 2.2.5p319 helped. I just realize the version of the Ruby that comes with Rails has to match to the one installed even though the RubyInstaller release gets ahead.



回答5:

I came here looking for answer, didn't help me, but I found a solution here, (it appears to be an issue with 1.3.11, downgrade to 1.3.10 did the trick)