Closed yurifarod closed 3 years ago
Could you check whether required MSVC redistributeable package is installed? See: https://www.rubydoc.info/github/kubo/ruby-oci8/file/docs/install-instant-client.md#Windows
Yes, inside my instant client directory have a "MSVCR71.DLL"
Could you post the following information?
ruby --version
cd \path-to-oracle-instant-client # Change this line
dir
return for "ruby --version"
ruby_ 2.4.4p296 (2018-03-28 revision 63013) [x64-mingw32]
Now i use
cd %ORACLE_HOME% dir
and this return...
11/10/2018 08:16
Thank u again for the help
ruby_ 2.4.4p296 (2018-03-28 revision 63013) [x64-mingw32]
The ruby is for Windows x64. You need to use Oracle instant client for Windows x64.
15/09/2014 21:28 1.015.808 oci.dll
However this seems Oracle instant client 12.1.0.2.0 for Windows 32-bit according to the timestamp and the file size.
$ unzip -l instantclient-basic-nt-12.1.0.2.0.zip | grep oci.dll # on linux
1015808 2014-09-16 11:28 instantclient_12_1/oci.dll
I see that, in my environment i can't change my intant client, but in my python scripts i have a resource to use other version of instant client
with this code:
os.chdir("C:\\app\\client\\12.1.0\\client_1")
have a similar code in ruby?
How about ENV['PATH'] = "C:\\app\\client\\12.1.0\\client_1;" + ENV['PATH']
before require 'oci8'
.
Just like this?
require "dbi" ENV['PATH'] = "C:\app\client\12.1.0\client_1;" + ENV['PATH'] require "oci8"
dbh = DBI.connect('DBI:OCI8:DBASE', 'user', 'password') dbh.disconnect
Did not work.
When you use double quotes, backslashes must be escaped as "C:\\app\\client\\12.1.0\\client_1;"
.
When you don't want to escape backslashes, you need to use single quotes as 'C:\app\client\12.1.0\client_1;'
.
I tried the both strings, none works.
I tried the both strings, none works.
I would like to confirm just in case. Did you get same errors; OCI.DLL: 126(The specified module could not be found. )
?
Is the OCI.DLL in C:\app\client\12.1.0\client_1
for Windows x64, not for Windows 32-bit?
Did you install Microsoft Visual C++ 2013 Redistributable Package to use Oracle instant client 12.1?
Yes, i use this client 12.1 in other project with Python. The oci.dll is x64
Do you use ruby distributed by rubyinstaller.org?
Could you change these lines as follows and post the output?
filename = File.join(path, 'OCI.DLL')
arch = dll_arch.call(filename)
puts("#{filename}: #{arch}") # I want to know this output.
if arch == ruby_arch
dll_dir = RubyInstaller::Runtime.add_dll_directory(path)
break
end
The return is:
undefined local variable or method
path' for main"`
But the my oci.dll is in my path (on the environment variables), it's necessary to my DB architecture.
@yurifarod You misunderstood what I wrote here. Could you replace these lines in oci8.rb installed on your machine and post its output?
What ruby do you use? Is it the ruby distributed by rubyinstaller.org?
If you use ruby-oci8 2.2.3 or earlier with ruby 2.4.4 distributed by rubyinstaller.org, it doesn't work. That's because rubyinstaller.org distributes customized rubies which restrict DLL search path. If you need to use old ruby-oci8, set RUBY_DLL_PATH
.
I use ruby-oci8-2.2.6.1-x64-mingw32 with the ruby 2.4.4 distributed by rubyinstaller.org. It work? I understand the changes in the oci8 now, i'll do this and return the result.
Sorry for no reply. I closed this due to inactivity, feel free to open another ticket if the problem persists.
Hello fellows, I have seens another Erros simillars to mine, but the solution proposals for the other cases don't work to me. I install the gems "dbi" and "ruby-oci8" with success. When i call the gems in the "irb" i have the answer TRUE to the command require 'dbi'. But when i command "require 'ruby-oci8'" or "require 'oci8'" the "irb" returns me this error: LoadError OCI.dll: 126 (The Specifiede module could note be...) I'm using a Windows 10 OS, i have the OCI.dll directory on the Path and a ORACLE_HOME in the environment variables. I daily use de instantclient in my work. All the other gems are working perfectly here. Anybody can help me?