title: Ruby SQLite3 OCRA executable missing sqlite_native.so
body: <p>I am trying to package the following ruby script with OCRA (I am on Windows 10, Ruby 2.6):</p>
  
  <pre class="lang-rb prettyprint-override"><code>require 'sqlite3'
  
  puts SQLite3::VERSION
  </code></pre>
  
  <p>Running this in cmd works properly:</p>
  
  <pre><code>C:\Users\monday\Documents\projects\sqlite3_test&gt;script.rb
  1.4.2
  </code></pre>
  
  <p>When I package <code>script.rb</code>  the following way:</p>
  
  <pre><code>ocra --gem-full=sqlite3 --dll sqlite3.dll script.rb --output script.exe --verbose
  </code></pre>
  
  <p>I have added <code>sqlite3.dll</code> and <code>sqlite3.def</code> to my <code>PATH</code> and into <code>C:\Ruby26-x64\bin</code> as per various suggestions on SO and GitHub.</p>
  
  <p>Here is the error that pops up when I run the resulting <code>script.exe</code>:</p>
  
  <pre><code>C:\Users\monday\Documents\projects\sqlite3_test&gt;script.exe
  Traceback (most recent call last):
          2: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/src/script.rb:1:in `&lt;main&gt;'
          1: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- sqlite3 (LoadError)
          6: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/src/script.rb:1:in `&lt;main&gt;'
          5: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in `require'
          4: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
          3: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `require'
          2: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3.rb:4:in `&lt;top (required)&gt;'
          1: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- sqlite3/2.6/sqlite3_native (LoadError)
          7: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/src/script.rb:1:in `&lt;main&gt;'
          6: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in `require'
          5: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
          4: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `require'
          3: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3.rb:2:in `&lt;top (required)&gt;'
          2: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3.rb:6:in `rescue in &lt;top (required)&gt;'
          1: from C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': 126: The specified module could not be found.   - C:/Users/monday/AppData/Local/Temp/ocr7747.tmp/lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3/sqlite3_native.so (LoadError)
  </code></pre>
  
  <p>I am sure that <code>lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3/sqlite3_native.so</code> is present in the temporary folder, judging by OCRA's output:</p>
  
  <pre><code>...
  m lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib
  a lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3.rb
  m lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3
  a lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3/constants.rb
  a lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3/database.rb
  a lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3/errors.rb
  a lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3/pragmas.rb
  a lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3/resultset.rb
  a lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3/sqlite3_native.so &lt;&lt;&lt; HERE!
  a lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3/statement.rb
  a lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3/translator.rb
  a lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3/value.rb
  a lib/ruby/gems/2.6.0/gems/sqlite3-1.4.2/lib/sqlite3/version.rb
  ...
  </code></pre>
  
  <p>What am I missing?</p>