[How to] install SQLite3 in Windows SketchUp

See:
Release SQLite3 gem - precompiled for SU · MSP-Greg/SUMisc (github.com)

Both 1.4.0 and 1.4.2 (actually master as 2020-12-09) are available supporting Ruby 2.2 thru 2.7.

Re SketchUp 2021, I ran all the tests within SU 2021 (Ruby 2.7), and they all passed. See notes in the link above.

Both gems are pre-compiled using MSYS2/MinGW, and all included Ruby versions pass the sqlite3-ruby test suite when used with stand-alone Ruby. Note that the Ruby in SketchUp 2021 is a mswin build.

1 Like

Hello, can it only be used in su2021?

It can used with Windows SketchUp 2017 and later. I only installed it in SU 2021 as I was concerned about it working with that…

I also want to recompile ruby gem on windows, but I don’t know how to do it. Do you have documents about it?

Not really. Among the issues:

  1. Recent SketchUp (SU) versions use an ‘mswin’ Ruby build, but the dll file is named x64-ucrt-ruby320.dll, which is what a Ruby MSYS2 UCRT64 build is named. So, to compile a ‘mswin’ gem one needs an ‘non-standard’ Ruby build. I have a few available on GitHub.

  2. One needs Visual Studio installed, and possibly MSYS2 UCRT tool-chain.

  3. Some gems require additional libraries/packages, e.g. Nokogiri requires XML related packages.

  4. Some gems won’t compile with ‘Visual Studio’ (mswin).

  5. Some gems may be able to be compiled with MSYS2 UCRT2 and successfully load/run in SU.

So, if three is true, and the gem can be built with mswin, one would normally use MSFT/vcpkg for packages.

If three is true and the gem can’t be built with mswin, one can install MSYS2 UCRT64 packages, and build the gem with MSYS2. One would need to test the gem in SU due to the possible compile/build system incompatibilities.

Two questions:

  1. What version(s) of SU would like to use the gems with?

  2. What gems would you like to use?

I have worked with stand-alone Ruby and related for several years. Hence, I’m very familiar with building Ruby and extension gems.

Many of the people using the SU Ruby API have never worked with (or installed) stand-alone Ruby. That’s fine, but it makes creating a ‘how-to’ document rather difficult…

1 Like