How to fix error requiring 'ibm_db' gem on Windows

痞子三分冷 提交于 2021-02-11 14:35:39

问题


I'm running Ruby 2.6.3p62 32-bit on Windows 10 64-bit. I installed it using the Ruby Installer. I successfully installed the gem 'ibm_db' without any errors. I downloaded the DB2-clidriver from http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/nt32_odbc_cli.zip, unzipped it an set the environment variable IBM_DB_HOME to its location. In addition, I added IBM_DB_HOME\bin to the PATH variable. When requiring the ibm_db I get the following error:

C:\Users\myuser\Programs\Ruby26\bin>ruby -e "require 'ibm_db'"
Traceback (most recent call last):
        2: from -e:1:in `<main>'
        1: from C:/Users/myuser/Programs/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
C:/Users/myuser/Programs/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- ibm_db (LoadError)
        9: from -e:1:in `<main>'
        8: from C:/Users/myuser/Programs/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:34:in `require'
        7: from C:/Users/myuser/Programs/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `rescue in require'
        6: from C:/Users/myuser/Programs/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:130:in `require'
        5: from C:/Users/myuser/Programs/Ruby26/lib/ruby/gems/2.6.0/gems/ibm_db-4.0.0-x86-mingw32/lib/ibm_db.rb:21:in `<top (required)>'
        4: from C:/Users/myuser/Programs/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        3: from C:/Users/myuser/Programs/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
        2: from C:/Users/myuser/Programs/Ruby26/lib/ruby/gems/2.6.0/gems/ibm_db-4.0.0-x86-mingw32/lib/mswin32/ibm_db.rb:90:in `<top (required)>'
        1: from C:/Users/myuser/Programs/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
C:/Users/myuser/Programs/Ruby26/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': 126: The specified module could not be found.   - C:/Users/myuser/Programs/Ruby26/lib/ruby/gems/2.6.0/gems/ibm_db-4.0.0-x86-mingw32/lib/mswin32/rb2x/i386/ibm_db.so (LoadError)

The file mentioned in the last line

C:/Users/myuser/Programs/Ruby26/lib/ruby/gems/2.6.0/gems/ibm_db-4.0.0-x86-mingw32/lib/mswin32/rb2x/i386/ibm_db.so

does exist.


回答1:


Your question may be better suited to the Github issues page for the ibm_db gem, because your question concerns configuration and does not concern either Ruby programming , or programming for Db2.

In particular see: https://github.com/ibmdb/ruby-ibmdb/issues/83

It appears that the ibm_db gem may not yet support your version of Ruby on your operating-system platform, but it may support an older version of Ruby.



来源:https://stackoverflow.com/questions/56850201/how-to-fix-error-requiring-ibm-db-gem-on-windows

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!