Ruby宝石包'ruby oci8'出现错误:'OCI.DLL: 126(找不到指定的模块。) (LoadError)'。

3

我的平台: - Ruby 2.2.2p95(2015-04-13修订版50295)[x64-mingw32] - Windows 7 64位

我已安装Oracle Instant客户端,即以下内容:

  • Oracle SDK
  • Oracle SQLPLUS
  • Oracle windows(我将用户变量路径指向Oracle windows安装客户端oci.dll的位置 - C:\ Users \ joebloggs \ Documents \ oracle \ oracle_windows \ instantclient_12_1)

以及Ruby宝石:

  • 'ruby-oci8'
  • 'activerecord'
  • 'activerecord-oracle_enhanced-adapter'

当我运行代码并在调用此方法之前尝试时,从activerecord ActiveRecord :: Base.establish_connection(...)遇到以下错误:

OCI.DLL: 126(The specified module could not be found.  ) (LoadError)
C:/Users/joebloggs/Documents/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
C:/Users/joebloggs/Documents/Ruby22-x64/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require' 
C:/Users/joebloggs/Documents/Ruby22-x64/lib/ruby/gems/2.2.0/gems/ruby-oci8-2.2.1-x64-mingw32/lib/oci8.rb:72:in `<top (required)>'

我看不出问题在哪里。PATH用户变量已正确设置为oci.dll在Oracle Windows目录中的位置。请问是否有人能帮忙?
非常感谢,Irvz。

注意:宝石的版本是:1. activerecord(4.2.6),2. activerecord-oracle_enhanced-adapter(1.6.7),3. ruby-oci8(2.2.1 x64-mingw32)。 - Irvz
如果OCI.DLL在PATH中确实存在,那么Oracle 12c OCI.DLL所依赖的MSVCR100.DLL在大多数情况下都无法找到。您需要安装“Microsoft Visual C++ 2010 Redistributable Package”或将MSVCR100.DLL复制到ruby.exe所在的目录中。请参见http://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-instant-client.md#Windows。 - Kubo Takehiro
1个回答

0

我需要将“32位”文件夹添加到$PATH中,而不是Instantclient安装的根文件夹。


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接