Windows 10 - sqlite3/sqlite3_native (LoadError)

849 views
Skip to first unread message

Mariusz Kutek

unread,
Sep 19, 2016, 7:24:24 AM9/19/16
to sqlite3-ruby
Hi, 

I have this error when I try to use mailcatcher. 

I'm working on windows 10 did fresh installation of ruby and gems. I try to reinstall sqlite3, copy it to ruby/bin folder etc. 
I have run out of any ideas how to fix it.

When I invoke mailcatcher i get this error:

C:\>mailcatcher
C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- sqlite3/sqlite3_native (LoadError)
        from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:6:in `rescue in <top (required)>'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11-x64-mingw32/lib/sqlite3.rb:2:in `<top (required)>'
        from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mailcatcher-0.6.5/lib/mail_catcher/mail.rb:4:in `<top (required)>'
        from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mailcatcher-0.6.5/lib/mail_catcher.rb:27:in `<top (required)>'
        from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby23-x64/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
        from C:/Ruby23-x64/lib/ruby/gems/2.3.0/gems/mailcatcher-0.6.5/bin/mailcatcher:3:in `<top (required)>'
        from C:/Ruby23-x64/bin/mailcatcher:23:in `load'
        from C:/Ruby23-x64/bin/mailcatcher:23:in `<main>'

C:\>where sqlite3.dll
C:\Ruby23-x64\bin\sqlite3.dll
C:\RailsInstaller\Ruby2.2.0\bin\sqlite3.dll


If there any one can help me it will be great, thank you in advance.

RodMcGuire

unread,
Sep 19, 2016, 3:47:48 PM9/19/16
to sqlite3-ruby


On Monday, September 19, 2016 at 7:24:24 AM UTC-4, Mariusz Kutek wrote ...

This issue came up when trying to get Instiki running on windows10. See: https://github.com/parasew/instiki/issues/38#issuecomment-243145259


The sqlite3 gem really needs to be updated and I don't know what preventing this. The the relevant instructions for the "fix": above is

  1.  From http://www.sqlite.org/download.html#win32"  I downloaded sqlite-autoconf-3140100.tar.gz
  2. I unzipped and untarred  that into C:/nLab/sqliteAuto/ giving: C:/nLab/sqliteAuto/sqlite-autoconf-3140100/
  3. In the devKit bash shell (C:\nLab\rubyDevKit\msys.bat), which has a bigger PATH than found in C:\Ruby23\bin\setrbvars.bat which is used by the Ruby Microsoft shell, I did:

cd /c/nLab/sqliteAuto/sqlite-autoconf-3140100
./configure --disable-shared
make install DESTDIR=/c/nLab/sqliteTMP
gem uninstall sqlite3 --all
gem install sqlite3 --platform=ruby -- --with-sqlite3-include=/c/nLab/sqliteTMP/usr/local/include --with-sqlite3-lib=/c/nLab/sqliteTMP/usr/local/lib

Then Instiki's .gemfile was patched to contain

gem "sqlite3", "1.3.11", :path => "/Ruby23/lib/ruby/gems/2.3.0/gems/sqlite3-1.3.11"

This got things running. I'm such a n00b at ruby I haven't yet figured out yet if the gem install step is necessary and whether instead its effect could be achieved in the .gemfile.

Reply all
Reply to author
Forward
0 new messages