Я столкнулся с серьезным ограничением и проблемой (я думаю, это связано с ОС), я просмотрел многие форумы, в том числе и на Ruby, но от них не было большой помощи; я действительно думаю, что это не очень хорошая поддержка или доступность API/библиотек для сообщества.
ДЕТАЛИ:
Рубиновая версия: 2.1.5p273
Рубиновый путь: C:\Ruby21\bin
Версия камня: 2.2.2
ОС: Windows 8.1 64-битная
Версия ORACLE: Oracle Database 12c Enterprise Edition Release 12.1.0.1.0 — 64-разрядная производственная версия
Oracle: D:\app\имя пользователя\продукт\12.1.0\dbhome_1
в CMD
gem install ruby-oci8 --source http://rubygems.org
но много ошибок:
checking for load library path...
PATH...
checking D:\app\Usern\product\12.1.0\dbhome_1\bin... skip: D:/app/Usern/product/12.1.0/dbhome_1/bin/oci.dll is for x86_64 cpu.
checking C:\app\Username\product\12.1.0\dbhome_3\bin... no
checking C:\app\Username\product\12.1.0\dbhome_2\bin... no
checking C:\app\Username\product\12.1.0\dbhome_1\bin... no
checking C:\Program Files (x86)\Intel\iCLS Client\... no
checking C:\Program Files\Intel\iCLS Client\... 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:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x86... no
checking C:\Program Files (x86)\Intel\OpenCL SDK\2.0\bin\x64... no
checking C:\Program Files\Intel\Intel(R) Management Engine Components\DAL... no
checking C:\Program Files\Intel\Intel(R) Management Engine Components\IPT... no
checking C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL... no
checking C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT... no
checking C:\Users\Username\AppData\Local\Smartbar\Application\... no
checking C:\Users\Username\AppData\Local\Smartbar\Application\... no
checking D:\Strawberry\c\bin... no
checking D:\Strawberry\perl\site\bin... no
checking D:\Strawberry\perl\bin... no
checking C:\php... no
checking C:\\bin... no
checking C:\scala\bin... no
checking C:\Ruby21\bin... no
checking C:\Program Files (x86)\Java\jdk1.7.0_40\bin... no
checking for cc... ---------------------------------------------------
Error Message:
The compiler failed to generate an executable file.
You have to install development tools first.
Error Message:
The compiler failed to generate an executable file.
You have to install development tools first.
Backtrace:
C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:456:in `try_do'
C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:541:in `try_link0'
C:/Ruby21/lib/ruby/2.1.0/mkmf.rb:840:in `try_run'
C:/Ruby21/ruby-oci8-2.1.7/ext/oci8/oraconf.rb:566:in `check_cc'
C:/Ruby21/ruby-oci8-2.1.7/ext/oci8/oraconf.rb:556:in `init'
C:/Ruby21/ruby-oci8-2.1.7/ext/oci8/oraconf.rb:705:in `initialize'
C:/Ruby21/ruby-oci8-2.1.7/ext/oci8/oraconf.rb:320:in `new'
C:/Ruby21/ruby-oci8-2.1.7/ext/oci8/oraconf.rb:320:in `get'
C:/Ruby21/ruby-oci8-2.1.7/ext/oci8/extconf.rb:18:in `<main>'
---------------------------------------------------
See:
* http://rubydoc.info/gems/ruby-oci8/file/docs/install-full-client.md for Oracle full client
* http://rubydoc.info/gems/ruby-oci8/file/docs/install-instant-client.md for Oracle instant client
* http://ruby-oci8.rubyforge.org/en/file.report-installation-issue.html to report an issue.
*** C:/Ruby21/ruby-oci8-2.1.7/ext/oci8/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.
Зачем мне это?
Я работаю с CSV-файлами, массивами и картами для небольшого упражнения... но мое решение идеально подходит для использования реальных таблиц БД и ссылочной целостности... но я боюсь, что никогда не установлю oci8 в ruby:
я показываю один пример кода, который не работает
require 'oci8'
#sqlplus fred/fred@localhost:1521/DB1
oci = OCI8.new('fred','fred','localhost:1521/DB1')
oci.exec('select sysdate from dual') do |record|
puts record
end
ERROR in Eclipse Luna:
C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- oci8 (LoadError)
from C:/Ruby21/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from C:/Users/Username/db.rb:1:in `<main>'