Skip to content

fails to load oci.dll on windows x64/msys2 rub 3.1.4p223 after update of msys2 #254

@net1957

Description

@net1957

For a long time I used this gem (ruby-oci8-2.2.12-x64-mingw-ucrt) on windows10 (latest version and patch) to connect to a Oracle11 DB located on a linux server.

I update the msys2 subsystem with ridk exec pacman -S -u -y 2 or times in a month.

And now this gem won't load.

I checked with a simple:
ruby -r oci8 -e "OCI8.new('dbpresenter', 'dbpresenter',' sk-oracle1.sk.loc/XE).exec('select login from users') do |r| puts r.join(','); end"

and it fail with
D:/program/Ruby/Ruby31-x64/lib/ruby/gems/3.1.0/gems/ruby-oci8-2.2.12-x64-mingw-ucrt/lib/oci8/check_load_error.rb:60:in block in check_os_specific_load_error': Cannot find DLLs depended by D:\program\Oracle\x64\instantclient_18_5\OCI.DLL. (LoadError)
See http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-instant-client.md#Windows
from D:/program/Ruby/Ruby31-x64/lib/ruby/gems/3.1.0/gems/ruby-oci8-2.2.12-x64-mingw-ucrt/lib/oci8/check_load_error.rb:48:in each' from D:/program/Ruby/Ruby31-x64/lib/ruby/gems/3.1.0/gems/ruby-oci8-2.2.12-x64-mingw-ucrt/lib/oci8/check_load_error.rb:48:in check_os_specific_load_error'
from D:/program/Ruby/Ruby31-x64/lib/ruby/gems/3.1.0/gems/ruby-oci8-2.2.12-x64-mingw-ucrt/lib/oci8/check_load_error.rb:138:in check_load_error' from D:/program/Ruby/Ruby31-x64/lib/ruby/gems/3.1.0/gems/ruby-oci8-2.2.12-x64-mingw-ucrt/lib/oci8.rb:115:in rescue in <top (required)>'
from D:/program/Ruby/Ruby31-x64/lib/ruby/gems/3.1.0/gems/ruby-oci8-2.2.12-x64-mingw-ucrt/lib/oci8.rb:113:in <top (required)>' from <internal:D:/program/Ruby/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:160:in require'
from internal:D:/program/Ruby/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:160:in rescue in require' from <internal:D:/program/Ruby/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:149:in require'
internal:D:/program/Ruby/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require': 126: Le module spÚcifiÚ est introuvable. - D:/program/Ruby/Ruby31-x64/lib/ruby/gems/3.1.0/gems/ruby-oci8-2.2.12-x64-mingw-ucrt/lib/oci8lib_310.so (LoadError) from <internal:D:/program/Ruby/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in require'
from D:/program/Ruby/Ruby31-x64/lib/ruby/gems/3.1.0/gems/ruby-oci8-2.2.12-x64-mingw-ucrt/lib/oci8.rb:112:in <top (required)>' from <internal:D:/program/Ruby/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:160:in require'
from internal:D:/program/Ruby/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:160:in rescue in require' from <internal:D:/program/Ruby/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:149:in require'
internal:D:/program/Ruby/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb:85:in require': cannot load such file -- oci8 (LoadError) from <internal:D:/program/Ruby/Ruby31-x64/lib/ruby/3.1.0/rubygems/core_ext/kernel_require.rb>:85:in require'
`

I checked that the correct Visual C++ runtime library is installed.
It fails with all supported versions of InstantClient!

I did remove the 314p2223 version and msys2 from the system and reinstalled it with the this package:
https://github.com/oneclick/rubyinstaller2/releases/download/RubyInstaller-3.1.4-1/rubyinstaller-devkit-3.1.4-1-x64.exe

the msys subsystem is:
D:\Dvlt\ruby\projects\_active>ridk exec uname -a MINGW64_NT-10.0-19045 SK-XPS 3.4.6.x86_64 2023-02-15 18:03 UTC x86_64 Msys

installed the ruby-oci8 gem:
D:\Dvlt\ruby\projects\_active>gem install ruby-oci8 Fetching ruby-oci8-2.2.12-x64-mingw-ucrt.gem Successfully installed ruby-oci8-2.2.12-x64-mingw-ucrt 1 gem installed

After that oci.dll is correctly loaded!
ruby -r oci8 -e "OCI8.new('dbpresenter', 'dbpresenter',' sk-oracle1.sk.loc/XE).exec('select login from users') do |r| puts r.join(','); end"

After upgrading msys2, it fail.

So, some library break ruby-oci8, but I don't have any clue about it. (the latest time it was running was may the 8)
the msys2 updates:

  • msys2-runtime-3.4.6-2-x86_64
  • pacman-6.0.2-6-x86_64
  • curl-8.1.1-2
  • gawk-5.2.2-1
  • less-633-1
  • libcurl-8.1.1-2
  • libgc-8.2.4-1
  • libgcrypt-1.10.2-1
  • libgpg-error-1.47-1
  • libgpgme-1.20.0-1
  • libhogweed-3.9-1
  • liblzma-5.4.3-1
  • libnettle-3.9-1
  • libnghttp2-1.53.0-1
  • libopenssl-3.1.0-2
  • libsqlite-3.42.0-2
  • libxml2-2.10.4-1
  • libzstd-1.5.5-1
  • mingw-w64-ucrt-x86_64-binutils-2.40-4
  • mingw-w64-ucrt-x86_64-crt-git-11.0.0.r18.g9df2e604d-1
  • mingw-w64-ucrt-x86_64-gcc-13.1.0-6
  • mingw-w64-ucrt-x86_64-gcc-libs-13.1.0-6
  • mingw-w64-ucrt-x86_64-headers-git-11.0.0.r18.g9df2e604d-1
  • mingw-w64-ucrt-x86_64-isl-0.26-1
  • mingw-w64-ucrt-x86_64-libmangle-git-11.0.0.r18.g9df2e604d-1
  • mingw-w64-ucrt-x86_64-libwinpthread-git-11.0.0.r18.g9df2e604d-1
  • mingw-w64-ucrt-x86_64-mpfr-4.2.0.p9-1
  • mingw-w64-ucrt-x86_64-tools-git-11.0.0.r18.g9df2e604d-1
  • mingw-w64-ucrt-x86_64-winpthreads-git-11.0.0.r18.g9df2e604d-1
  • mingw-w64-ucrt-x86_64-zstd-1.5.5-1
  • mpfr-4.2.0.p9-1
  • nettle-3.9-1
  • openssl-3.1.0-2
  • pacman-contrib-1.9.0-1
  • rebase-4.5.0-4
  • tcl-8.6.12-3
  • wget-1.21.4-1
  • xz-5.4.3-1
  • zstd-1.5.5-1

On ruby 3.2.2 it work with the laatest msys update:
D:\Dvlt\ruby\projects\_active>ridk exec uname -a
MINGW64_NT-10.0-19045 SK-XPS 3.4.6.x86_64 2023-04-01 11:43 UTC x86_64 Msys`

Could you help me about this problem?
regards

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions