【发布时间】:2016-06-29 15:29:53
【问题描述】:
我的平台: - 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-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。
【问题讨论】:
-
注意:gem 的版本是:1. activerecord (4.2.6), 2. activerecord-oracle_enhanced-adapter (1.6.7), 3. ruby-oci8 (2.2.1 x64- mingw32).
-
如果 OCI.DLL 确实在 PATH 中,则大多数情况下都找不到 Oracle 12c OCI.DLL 依赖的 MSVCR100.DLL。您需要安装“Microsoft Visual C++ 2010 Redistributable Package”或将 MSVCR100.DLL 复制到 ruby.exe 所在目录。见rubydoc.info/github/kubo/ruby-oci8/file/docs/…
标签: ruby windows oracle activerecord oci8