Error : 'incompatible library version' sqlite3-1.3.11 in rails
Asked Answered
V

5

4

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
Vasily answered 1/5, 2016 at 4:22 Comment(3)
Can you post the output of gem install sqlite3 -v '1.3.11'?Communist
did you figure this problem out, i am having the exact same issueShala
@Sebin, i update my question and post output of gem install sqlite3 -v '1.3.11' @NickGarver, i not get any solution yet.Vasily
P
14

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
Pseudohermaphroditism answered 1/5, 2016 at 4:50 Comment(1)
Thanks for reply but your solution is not worked for me. I update question based on your solution.Vasily
H
1

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

Halmahera answered 15/7, 2016 at 11:26 Comment(0)
R
1

@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.

Riviera answered 7/9, 2016 at 7:55 Comment(0)
J
0

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.

Jedlicka answered 3/9, 2016 at 4:19 Comment(0)
T
0

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)

Tetragonal answered 15/6, 2018 at 4:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.