# Unable to load sqlite3 library in Sketcup Pro 2019 version

**URL:** <https://forums.sketchup.com/t/unable-to-load-sqlite3-library-in-sketcup-pro-2019-version/88264>\
**Category:** Ruby API\
**Created:** [February 15, 2019, 9:48am UTC](https://forums.sketchup.com/t/unable-to-load-sqlite3-library-in-sketcup-pro-2019-version/88264 "2019-02-15T09:48:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![mallikarjunece](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mallikarjunece/32/63975_2.png) [@mallikarjunece](https://forums.sketchup.com/u/mallikarjunece)\
**Post date:** [February 15, 2019, 9:48am UTC](https://forums.sketchup.com/t/unable-to-load-sqlite3-library-in-sketcup-pro-2019-version/88264/1 "2019-02-15T09:48:59Z")

</div>

Hi Team,

I am a Sketchup Pro user and have on a ruby plugin. While using the plugin in recent/latest Sketchup 2019 version, the plugin is showing some issues with **sqlite3** library.

The **sqlite3** library is working in the terminal(command prompt) with same Ruby version 2.5.1.

But, it is not loading inside Sketchup 2019, working fine in 2018 version.

Error logs:

```auto
Error: #<Sequel::AdapterNotFound: LoadError: 126: The specified module could not be found. - ***/gems/sqlite3/sqlite3_native.so> - This is available in this location.
C:/Program Files/SketchUp/SketchUp 2019/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:59:in `require'
C:/Program Files/SketchUp/SketchUp 2019/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:59:in `require'
C:/Program Files/SketchUp/SketchUp 2019/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:59:in `require'
C:/Program Files/SketchUp/SketchUp 2019/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:59:in `require'
C:/Program Files/SketchUp/SketchUp 2019/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:59:in `require'
C:/Program Files/SketchUp/SketchUp 2019/Tools/RubyStdLib/rubygems/core_ext/kernel_require.rb:59:in `require'
...
C:/Program Files/SketchUp/SketchUp 2019/Tools/RubyStdLib/singleton.rb:141:in `new'
C:/Program Files/SketchUp/SketchUp 2019/Tools/RubyStdLib/singleton.rb:141:in `block in instance'
C:/Program Files/SketchUp/SketchUp 2019/Tools/RubyStdLib/singleton.rb:139:in `synchronize'
C:/Program Files/SketchUp/SketchUp 2019/Tools/RubyStdLib/singleton.rb:139:in `instance'
C:/SunDAT/loader.rb:23:in `<top (required)>'
C:/Program Files/SketchUp/SketchUp 2019/Tools/extensions.rb:197:in `require'
C:/Program Files/SketchUp/SketchUp 2019/Tools/extensions.rb:197:in `load'
C:/Users/Arjun/AppData/Roaming/SketchUp/SketchUp 2019/SketchUp/Plugins/sundat_extension.rb:15:in `register_extension'
C:/Users/Arjun/AppData/Roaming/SketchUp/SketchUp 2019/SketchUp/Plugins/sundat_extension.rb:15:in `<top (required)>'

```

Kindly let me know, how to resolve this.

Thanks,  
Mallikarjuna.

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [February 16, 2019, 8:21am UTC](https://forums.sketchup.com/t/unable-to-load-sqlite3-library-in-sketcup-pro-2019-version/88264/2 "2019-02-16T08:21:09Z")

</div>

Here is a thread that might give some clues

Pinging @NiCa60

> [@Using SQLite from SketchUp 2016](https://forums.sketchup.com/t/using-sqlite-from-sketchup-2016/28512/2):
>
> 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/](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?](http://stackoverflow.com/questions/15480381/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 \>req…

---

<div class="post-metadata">

**Author:** ![mallikarjunece](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mallikarjunece/32/63975_2.png) [@mallikarjunece](https://forums.sketchup.com/u/mallikarjunece)\
**Post date:** [February 17, 2019, 4:03am UTC](https://forums.sketchup.com/t/unable-to-load-sqlite3-library-in-sketcup-pro-2019-version/88264/3 "2019-02-17T04:03:37Z")

</div>

Hi, Thanks for your reply.

I am facing this issue with Sketchup 2019 only, and no issues with 2018 version.

As mentioned in this, Sqlite installation is success and working fine in IRB also.

The only issue is not working in Sketchup 2019 alone…

#SketchupTeam: Kindly let me know how to resolve this.

Thanks,  
Mallikarjuna.

---

<div class="post-metadata">

**Author:** ![MikeWayzovski](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mikewayzovski/32/98346_2.png) [@MikeWayzovski](https://forums.sketchup.com/u/MikeWayzovski)\
**Post date:** [February 17, 2019, 7:16am UTC](https://forums.sketchup.com/t/unable-to-load-sqlite3-library-in-sketcup-pro-2019-version/88264/4 "2019-02-17T07:16:32Z")

</div>

The SketchUp team has no control over third party extension developers, so you need to contact them, or get help from other users, which was why I pinged @NiCa60 …  
But maybe he might not be involved with this user forum, anymore.

---

<div class="post-metadata">

**Author:** ![MSP\_Greg](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/msp_greg/32/206066_2.png) [@MSP\_Greg](https://forums.sketchup.com/u/MSP_Greg)\
**Post date:** [February 18, 2019, 12:41am UTC](https://forums.sketchup.com/t/unable-to-load-sqlite3-library-in-sketcup-pro-2019-version/88264/5 "2019-02-18T00:41:59Z")

</div>

> [@mallikarjunece](#):
>
> Error: #\<Sequel::AdapterNotFound: LoadError: 126: The specified module could not be found. - \*\*\*/gems/sqlite3/sqlite3\_native.so\>

Normally this error means the file exists, but it can’t find a dll it should link to or load. Try adding `msys64/mingw64/bin` (add prefix) to `ENV['PATH']`, then require it.

In this case, it’s looking for dll’s that are part of the MSYS2/MinGW sqlite3 package. I believe that would be `libsqlite3-0.dll`…

---

<div class="post-metadata">

**Author:** ![mallikarjunece](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/mallikarjunece/32/63975_2.png) [@mallikarjunece](https://forums.sketchup.com/u/mallikarjunece)\
**Post date:** [February 18, 2019, 5:57am UTC](https://forums.sketchup.com/t/unable-to-load-sqlite3-library-in-sketcup-pro-2019-version/88264/6 "2019-02-18T05:57:39Z")

</div>

Hi,

Thanks for your reply,

**Tried this, but not working…**

Kindly let me know other options, if any.

Regards,  
Mallikarjuna.

---

<div class="post-metadata">

**Author:** ![tt\_su](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/tt_su/32/17_2.png) [@tt\_su](https://forums.sketchup.com/u/tt_su)\
**Post date:** [February 18, 2019, 11:19am UTC](https://forums.sketchup.com/t/unable-to-load-sqlite3-library-in-sketcup-pro-2019-version/88264/7 "2019-02-18T11:19:51Z")

</div>

Using gems isn’t something we support. In a shared environment like SketchUp it’s problematic to avoid version conflicts. (See more details: [How to use a local ruby gem inside a Sketchup Extension - #15 by tt\_su](https://forums.sketchup.com/t/how-to-use-a-local-ruby-gem-inside-a-sketchup-extension/76665/15))

In addition to the conflict issue, some extensions require compiling, which doesn’t work out of the box on Windows because there is no default system compiler to do so, and you cannot expect end users to have this available.

You could try to install it in your local system Ruby installation, Then copy the gem into your extension. ([Installing ruby gems in Sketchup - #2 by tt\_su](https://forums.sketchup.com/t/installing-ruby-gems-in-sketchup/3787/2)) That would be ok for your own usage. But, if you plan to distribute it I would recommend you fork the gem and wrap it in your own namespace, then build and bundle it into your extension’s namespace.

That way you avoid clashing with other extensions (requirement to be listed on Extension Warehouse). And you avoid the potential `gem install`/`Gem.install` issues on user’s machine. (Might fail due to expired SSL certs on older SU versions. Freezes SketchUp for the duration of the gem installation.)

---

<div class="post-metadata">

**Author:** ![MSP\_Greg](https://sea2.discourse-cdn.com/sketchup/user_avatar/forums.sketchup.com/msp_greg/32/206066_2.png) [@MSP\_Greg](https://forums.sketchup.com/u/MSP_Greg)\
**Post date:** [February 18, 2019, 4:11pm UTC](https://forums.sketchup.com/t/unable-to-load-sqlite3-library-in-sketcup-pro-2019-version/88264/8 "2019-02-18T16:11:35Z")

</div>

> [@mallikarjunece](#):
>
> **Tried this, but not working…**
> 
> Kindly let me know other options, if any.

Ok. First, everything Thomas said. Extension gems are almost impossible to use in a ‘generic plugin’ for public use. Conversely, if you need it for a controlled ‘local users’ application where you can perform additional setup steps, one should be able to use anything that can be used with stand-alone Ruby.

That said, this may not be trivial. Also, at present, I don’t have (or need) SketchUp, although I’ve used it in the past. Conversely, many would consider me a ‘knowledgeable windows Ruby user’.

So, if you want to move forward:

1. I just quickly built SQLite3 on Ruby trunk (2.7), and using the example code at [GitHub - sparklemotion/sqlite3-ruby: Ruby bindings for the SQLite3 embedded database](https://github.com/sparklemotion/sqlite3-ruby), it’s working fine. I did need to install `mingw-w64-x86_64-dlfcn`, which isn’t done automatically.

2. How did you install the gem in SketchUp? Are you sure that’s correct?

3. If you’re not sure about 2, using the `--user-install` option should make it available in SketchUp, but that depends on how Trimble setup Ruby. If the value of `Gem.user_dir` matches in both stand-alone Ruby and SketchUp Ruby, it can be used as a common gem install location.
