Error installing ruby-oci8-2.1.5 gem
Trying to get a basic SQL call to Oracle up and working and am having troubles getting ruby-OCI8 installed
I'm using Windows 7 64-bit
ruby -v
1.9.3p448 (2013-06-27) [i386-mingw32]
ruby -e "require 'oci8'"
C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in require': cannot load such file -- oci8 (LoadError ) from C:/Ruby193/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in
require'
from -e:1:in `
'
I installed the Oracle Instant client, SDK and SQL*PLUS files to c:\oracle\instantclient_12_1
My LD_LIBRARY_PATH envvar is set to c:\oracle\instantclient_12_1
gem install ruby-oci8-2.1.5 results in ....
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing ruby-oci8-2.1.5.gem:
ERROR: Failed to build gem native extension.
C:/Ruby193/bin/ruby.exe extconf.rb
checking for load library path...
PATH...
checking D:\Users\204055447\Downloads\DevKit\bin... no
checking D:\Users\204055447\Downloads\DevKit\mingw\bin... no
checking C:\Program Files (x86)\Windows Resource Kits\Tools... no
checking C:\Sybase\DataAccess\OLEDB\dll... no
checking C:\Sybase\DataAccess\ODBC\dll... no
checking C:\Sybase\OCS-12_5\lib3p... no
checking C:\Sybase\ADO.NET\dll... no
checking C:\Sybase\OLEDB... no
checking C:\Sybase\ODBC... no
checking C:\Sybase\OCS-12_5\dll... no
checking C:\Sybase\OCS-12_5\bin... no
checking C:\Program Files (x86)\CA\SC\CAWIN... no
checking C:\Windows\system32... no
checking C:\Windows... no
checking C:\Windows\System32\Wbem... no
checking C:\Windows\System32\WindowsPowerShell\v1.0... no
checking C:\Apps\Tcl\bin... no
checking C:\Apps\perl\bin... no
checking C:\Program Files (x86)\CA\SC\Csam\SockAdapter\bin... no
checking C:\Program Files (x86)\CA\DSM\bin... no
checking C:\Program Files (x86)\CA\SC\CBB... no
checking C:\PROGRA~2\CA\SC\CAM\bin... no
checking c:\apps\Cygwin\bin... no
checking C:\Program Files\TextPad 4... no
checking c:\apps\bin... no
checking c:\apps\lib... no
checking c:\Program Files (x86)\SQLite... no
checking c:\Program Files (x86)\TextPad 4... no
checking C:\Ruby193\bin... no
checking C:\Oracle\instantclient_12_1... yes
C:/Oracle/instantclient_12_1/oci.dll looks like a full client.
checking for cc... ok
checking for gcc... yes
checking for LP64... no
checking for sys/types.h... yes
checking for ruby header... ok
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/Ruby193/bin/ruby
--with-instant-client
--without-instant-client
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:57:in enum_homes': RuntimeError (RuntimeError) from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:787:in
get_home'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:705:in initialize' from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:320:in
new'
from C:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:320:in get' from extconf.rb:18:in
'
Error Message:
MiniRegistry::MiniRegistryError
Backtrace:
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:57:in enum_homes' C:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:787:in
get_home'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:705:in initialize' C:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:320:in
new'
C:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/oraconf.rb:320:in get' extconf.rb:18:in
'
See:
Gem files will remain installed in C:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5 for inspection.
Results logged to C:/Ruby193/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.1.5/ext/oci8/gem_make.out
My installed Gems are:
*** LOCAL GEMS ***
bigdecimal (1.2.1, 1.1.0)
builder (3.2.2)
bundler (1.3.5)
childprocess (0.3.9)
cucumber (1.3.6)
diff-lcs (1.2.4)
ffi (1.9.0 x86-mingw32)
gherkin (2.12.1 x86-mingw32)
io-console (0.4.2, 0.3)
json (1.8.0, 1.5.5)
minitest (5.0.6, 2.5.1)
multi_json (1.7.9)
multi_test (0.0.2)
rake (10.1.0, 0.9.2.2)
rdoc (4.0.1, 3.9.5)
rspec-expectations (2.14.2)
ruby-plsql (0.5.0)
rubyzip (0.9.9)
selenium-webdriver (2.35.0)
websocket (1.0.4)
**** UPDATE: Aug-21-2013 @14:34 ET
I noticed the following unusual "permission denied" activity in my mkmf.log file ....
"gcc -o conftest -IC:/Ruby193/include/ruby-1.9.1/i386-mingw32 -IC:/Ruby193/include/ruby-1.9.1/ruby/backward -IC:/Ruby193/include/ruby-1.9.1 -I. -DFD_SETSIZE=2048 -DFD_SETSIZE=2048 -O3 -fno-omit-frame-pointer -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c -L. -LC:/Ruby193/lib -L. -lmsvcrt-ruby191 -lshell32 -lws2_32 -limagehlp -lshlwapi "
d:/users/204055447/downloads/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: reopening conftest.exe: Permission denied
d:/users/204055447/downloads/devkit/mingw/bin/../lib/gcc/mingw32/4.5.2/../../../../mingw32/bin/ld.exe: final link failed: Permission denied
*** UPDATE Aug-21 @16:28 ET
Got rid of the permission error by adding the following to mkmf.rb as suggested at http://ruby-oci8.rubyforge.org/en/file.platform-specific-issues.html
def try_run(src, opt="")
if try_link0(src, opt)
xsystem("./conftest")
else
nil
end
ensure
# add the following one line.
sleep 1 if /mswin32|cygwin|mingw32|bccwin32/ =~ RUBY_PLATFORM
rm_f "conftest"
end
The permission error went away but the other MiniRegistryError remains which appears to come from the following code in oraconf.rb. QUESTION: Why is SOFTWARE\ORACLE expected to be found in my Registry. It's not there but why does this script think it should be? That's the whole purpose of the Oracle Instant Client
code = RegOpenKeyExA.call(HKEY_LOCAL_MACHINE, 'SOFTWARE\ORACLE', 0, 0x20019, phkResult)
if code != ERROR_SUCCESS
raise MiniRegistryError.new("Win32::RegOpenKeyExA", code)
end
Any thoughts?