I’m porting a plugin that used to work on older version of SketchUp (Ruby 1.8.6) to SketchUp 2016. The plugin is used internally by a forniture company with more than 100 internal users and many external users. They do not want to use the Extension Warehouse, so I need to continue with my own installer.
I’m stuck with the SQLite usage, that is not working anymore.
Previously, I used to copy the “sqlite3_api.so” file into the same folder (inside my plugin folder) where the SQLite ruby file are, and the “sqlite3.dll” to the “C:\Windows folder”, and this was good for both 32 and 64 bit.
Reading some SQLite related threads, in this site I’ve stepped into a @DanRathbun comment: “Well you need two, one for 32bit and one for 64bit.” ( from cannot-install-ruby-gem-in-osx ).
Someone knows where I can download the 64 bit “sqlite3_api.so” file?
Moreover, looking at the ruby docs, it seems that from the 1.9 version of Ruby the .so usage is deprecated in favor of DL usage, and from 2.0 DL is deprecated in favor of Fiddle, both of them I don know about.
Anyway, if is possible to continue with the .so file, I’ll be fine (and very happy!).
After more research, I’ve decided to first try to install SQLite3 on Ruby and then try to make it work on SketchUp.
So, from http://rubyinstaller.org/downloads/, I’ve installed:
- Ruby 2.0.0-p648 (x64)
- Development Kit for Ruby 2.0 and above (x64 - 64bits only) DevKit-mingw64-64-4.7.2-20130224-1432-sfx.exe
Then I’ve followed the instruction found on StackOverflow: How do I install sqlite3 for Ruby on Windows?
I’ve successfully installed the sqlite3 gem but when I try tu use it on irb with >require “sqlite3” I still get the error stating that he can’t find the sqlite3_native.so (giving me the full path). Odd enough the file is present on that path!
I’ve finally succeeded to run sqlite3 gem on Ruby, using the SQLite DLL “libsqlite3-0.dll” found on the “C:\sqlite-autoconf-3130000.libs” folder (the “C:\sqlite-autoconf-3130000” folder was the one where I did extract the C source downloaded from the SQLite web site).
To make it works on irb, I’ve copied it on the bin folder of ruby installation (on my case “C:\Ruby200-x64\bin”).
Then I’ve copied the “sqlite3_native.so” on my plugin source and the “libsqlite3-0.dll” on the “C:\Program Files\SketchUp\SketchUp 2016\Tools\RubyStdLib\platform_specific” folder.
And now it works also in SketchUp 2016