如何修复Windows上需要'ibm_db'gem的错误 [英] How to fix error requiring 'ibm_db' gem on Windows

查看:49
本文介绍了如何修复Windows上需要'ibm_db'gem的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在Windows 10 64位上运行32位Ruby 2.6.3p62.我使用Ruby安装程序安装了它.我已成功安装了gem'ibm_db',没有任何错误.我从 http://public.dhe.ibm.com/ibmdl/export/pub/software/data/db2/drivers/odbc_cli/nt32_odbc_cli.zip ,将其解压缩并将环境变量IBM_DB_HOME设置为其位置.另外,我将IBM_DB_HOME \ bin添加到PATH变量中.当需要ibm_db时,出现以下错误:

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)

最后一行提到的文件

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

存在.

推荐答案

您的问题可能更适合Github

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.

尤其请参阅: https://github.com/ibmdb/ruby-ibmdb/issues/83

看来ibm_db gem可能尚未在您的操作系统平台上支持您的Ruby版本,但是它可能支持较旧的Ruby版本.

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.

这篇关于如何修复Windows上需要'ibm_db'gem的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆