使用DB2客户端安装ruby gem ibm_db时出错

时间:2017-10-06 06:29:13

标签: ruby-on-rails ruby rubygems db2

我收到以下错误:

gem install ibm_db
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing ibm_db:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ibm_db-3.0.4/ext
C:/Ruby21-x64/bin/ruby.exe -r ./siteconf20171018-4480-1i7vx9n.rb extconf.rb
Detected 64-bit Ruby

Detected usage of IBM Data Server Driver package. Ensure you have downloaded 64-bit package of IBM_Data_Server_Driver and retry the 'gem install ibm_db' command

creating gil_release_version
creating unicode_support_version
checking for SQLConnect() in -ldb2cli... yes
checking for gil_release_version... yes
checking for unicode_support_version... yes
creating Makefile

current directory: C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ibm_db-3.0.4/ext
make "DESTDIR=" clean

current directory: C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ibm_db-3.0.4/ext
make "DESTDIR="
generating ibm_db-x64-mingw32.def
compiling ibm_db.c
In file included from C:\Program Files\IBM\SQLLIB/include/sqlcli.h:983:0,
                 from C:\Program Files\IBM\SQLLIB/include/sqlcli1.h:45,
                 from ruby_ibm_db_cli.h:52,
                 from ibm_db.c:27:
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1748:5: error: unknown type name '__in_ecount'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1751:5: error: unknown type name '__out_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1754:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1865:5: error: unknown type name '__in_ecount'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1868:5: error: unknown type name '__out_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1871:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1891:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1894:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1897:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1900:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1907:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1909:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1911:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1913:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1920:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1922:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1927:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1930:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1933:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1936:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1939:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1942:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1952:5: error: unknown type name '__in_ecount'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1954:5: error: unknown type name '__out_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1961:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1971:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1974:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1977:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1983:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1986:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1989:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1992:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:1998:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2001:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2004:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2018:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2021:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2024:5: error: unknown type name '__in_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2031:5: error: unknown type name '__out_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2034:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2036:5: error: unknown type name '__out_ecount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2039:5: error: unknown type name '__out_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2087:5: error: unknown type name '__out'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2128:5: error: unknown type name '__in_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2129:5: error: unknown type name '__out_bcount_opt'
C:\Program Files\IBM\SQLLIB/include/sqlext.h:2130:5: error: unknown type name '__in'
ibm_db.c:104:0: warning: "STRCASECMP" redefined [enabled by default]
In file included from c:/Ruby21-x64/include/ruby-2.1.0/ruby.h:33:0,
                 from ibm_db.c:21:
c:/Ruby21-x64/include/ruby-2.1.0/ruby/ruby.h:1783:0: note: this is the location of the previous definition
ibm_db.c: In function '_ruby_ibm_db_free_conn_struct':
ibm_db.c:490:7: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
ibm_db.c: In function 'ibm_Ruby_Thread_Call':
ibm_db.c:696:5: warning: implicit declaration of function 'rb_thread_call_without_gvl' [-Wimplicit-function-declaration]
ibm_db.c: In function '_ruby_ibm_db_free_stmt_handle_and_resources':
ibm_db.c:718:7: warning: variable 'rc' set but not used [-Wunused-but-set-variable]
ibm_db.c: In function '_ruby_ibm_db_assign_options':
ibm_db.c:1430:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ibm_db.c:1513:35: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ibm_db.c: In function '_ruby_ibm_db_connect_helper2':
ibm_db.c:2181:34: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ibm_db.c:2360:41: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ibm_db.c: In function '_ruby_ibm_db_connect_helper':
ibm_db.c:2538:26: warning: comparison between pointer and integer [enabled by default]
ibm_db.c: In function 'ibm_db_createDBNX':
ibm_db.c:3255:9: warning: unused variable 'return_value' [-Wunused-variable]
ibm_db.c: In function 'ibm_db_autocommit':
ibm_db.c:3328:37: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
ibm_db.c: In function '_ruby_ibm_db_bind_parameter_helper':
ibm_db.c:6232:30: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
ibm_db.c:6256:53: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
ibm_db.c: In function 'ibm_db_execute':
ibm_db.c:7108:73: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
ibm_db.c: In function 'ibm_db_field_type':
ibm_db.c:8415:30: warning: initialization discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8438:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8446:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8449:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8452:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8455:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8458:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8461:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8464:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c:8467:15: warning: assignment discards 'const' qualifier from pointer target type [enabled by default]
ibm_db.c: In function 'ibm_db_result_cols':
ibm_db.c:10126:9: warning: unused variable 'ret_val' [-Wunused-variable]
ibm_db.c: In function 'ibm_db_server_info':
ibm_db.c:11252:17: warning: the comparison will always evaluate as 'false' for the address of 'connection' will never be NULL [-Waddress]
ibm_db.c: At top level:
ibm_db.c:48:13: warning: '_ruby_ibm_db_set_decfloat_rounding_mode_client' declared 'static' but never defined [-Wunused-function]
ibm_db.c:49:14: warning: '_ruby_ibm_db_instance_name' defined but not used [-Wunused-variable]
ibm_db.c:2592:12: warning: '_ruby_ibm_db_set_decfloat_rounding_mode_client_helper' defined but not used [-Wunused-function]
ibm_db.c: In function '_ruby_ibm_db_connect_helper2':
ibm_db.c:2433:1: warning: control reaches end of non-void function [-Wreturn-type]
ibm_db.c: In function 'ibm_Ruby_Thread_Call':
ibm_db.c:710:3: warning: control reaches end of non-void function [-Wreturn-type]
make: *** [ibm_db.o] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Ruby21-x64/lib/ruby/gems/2.1.0/gems/ibm_db-3.0.4 for inspection.
Results logged to C:/Ruby21-x64/lib/ruby/gems/2.1.0/extensions/x64-mingw32/2.1.0/ibm_db-3.0.4/gem_make.out

我正在尝试在本地Ruby on Rails中开发到远程DB2数据库,我已经设置了指向我的DB2 cli和db2dsdriver.cfg配置文件的全局变量以及连接设置。 我也尝试过使用IBM数据服务器驱动程序包,但未检测到cli。 有什么建议?如何安装ibm_db gem并连接到DB2 ??

====== LoG:======================================= ====================

gil_release_version is:
/* begin */
1: #ifndef GIL_RELEASE_VERSION
2: #define GIL_RELEASE_VERSION
3: #endif
/* end */

unicode_support_version is:
/* begin */
1: #ifndef UNICODE_SUPPORT_VERSION
2: #define UNICODE_SUPPORT_VERSION
3: #endif
/* end */

have_library: checking for SQLConnect() in -ldb2cli... -------------------- yes

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -IC:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -IC:/Ruby21-x64/include/ruby-2.1.0 -I. "-IC:\Program Files\IBM\SQLLIB/include" -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby21-x64/lib -L"C:\Program Files\IBM\SQLLIB/lib" -L.      -lx64-msvcrt-ruby210  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return 0;
8: }
/* end */

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -IC:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -IC:/Ruby21-x64/include/ruby-2.1.0 -I. "-IC:\Program Files\IBM\SQLLIB/include" -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby21-x64/lib -L"C:\Program Files\IBM\SQLLIB/lib" -L.      -lx64-msvcrt-ruby210 -ldb2cli  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
conftest.c: In function 't':
conftest.c:16:57: error: 'SQLConnect' undeclared (first use in this function)
conftest.c:16:57: note: each undeclared identifier is reported only once for each function it appears in
conftest.c:16:32: warning: variable 'p' set but not used [-Wunused-but-set-variable]
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { void ((*volatile p)()); p = (void ((*)()))SQLConnect; return 0; }
/* end */

"x86_64-w64-mingw32-gcc -o conftest.exe -IC:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -IC:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -IC:/Ruby21-x64/include/ruby-2.1.0 -I. "-IC:\Program Files\IBM\SQLLIB/include" -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration conftest.c  -L. -LC:/Ruby21-x64/lib -L"C:\Program Files\IBM\SQLLIB/lib" -L.      -lx64-msvcrt-ruby210 -ldb2cli  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi  "
conftest.c: In function 't':
conftest.c:16:1: warning: implicit declaration of function 'SQLConnect' [-Wimplicit-function-declaration]
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: #include <winsock2.h>
 4: #include <windows.h>
 5: 
 6: /*top*/
 7: extern int t(void);
 8: int main(int argc, char **argv)
 9: {
10:   if (argc > 1000000) {
11:     printf("%p", &t);
12:   }
13: 
14:   return 0;
15: }
16: int t(void) { SQLConnect(); return 0; }
/* end */

--------------------

have_header: checking for gil_release_version... -------------------- yes

"x86_64-w64-mingw32-gcc -E -IC:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -IC:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -IC:/Ruby21-x64/include/ruby-2.1.0 -I. "-IC:\Program Files\IBM\SQLLIB/include" -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <gil_release_version>
/* end */

--------------------

have_header: checking for unicode_support_version... -------------------- yes

"x86_64-w64-mingw32-gcc -E -IC:/Ruby21-x64/include/ruby-2.1.0/x64-mingw32 -IC:/Ruby21-x64/include/ruby-2.1.0/ruby/backward -IC:/Ruby21-x64/include/ruby-2.1.0 -I. "-IC:\Program Files\IBM\SQLLIB/include" -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0501 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64   -O3 -fno-omit-frame-pointer -fno-fast-math -g -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration  conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: #include <unicode_support_version>
/* end */

--------------------

我正在使用......

  • Ruby 2.1.5
  • 的devkit-mingw64-64-4.7.2-20130224-1432-SFX
  • Gem ibm_db 3.0.4 x86-mingw32
  • IBM数据服务器客户端10.5
  • 通过Windows 10

RubyGems环境:

      - RUBYGEMS VERSION: 2.6.13
      - RUBY VERSION: 2.1.5 (2014-11-13 patchlevel 273) [x64-mingw32]
      - INSTALLATION DIRECTORY: C:/Ruby21-x64/lib/ruby/gems/2.1.0
      - USER INSTALLATION DIRECTORY: C:/Users/mypc/.gem/ruby/2.1.0
      - RUBY EXECUTABLE: C:/Ruby21-x64/bin/ruby.exe
      - EXECUTABLE DIRECTORY: C:/Ruby21-x64/bin
      - SPEC CACHE DIRECTORY: C:/Users/mypc/.gem/specs
      - SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
      - RUBYGEMS PLATFORMS:
        - ruby
        - x64-mingw32
      - GEM PATHS:
         - C:/Ruby21-x64/lib/ruby/gems/2.1.0
         - C:/Users/mypc/.gem/ruby/2.1.0
      - GEM CONFIGURATION:
         - :update_sources => true
         - :verbose => true
         - :backtrace => false
         - :bulk_threshold => 1000
      - REMOTE SOURCES:
         - https://rubygems.org/
      - SHELL PATH:
         - C:\Program Files (x86)\Intel\iCLS Client\
         - C:\Program Files\Intel\iCLS Client\
         - C:\Windows\system32
         - C:\Windows
         - C:\Windows\System32\Wbem
         - C:\Windows\System32\WindowsPowerShell\v1.0\
         - C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL
         - C:\Program Files\Intel\Intel(R) Management Engine Components\DAL
         - C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT
         - C:\Program Files\Intel\Intel(R) Management Engine Components\IPT
         - C:\PROGRA~1\IBM\SQLLIB\BIN
         - C:\PROGRA~1\IBM\SQLLIB\FUNCTION
         - C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL
         - C:\Ruby23-x64\bin
         - C:\Ruby24-x64\bin
         - C:\Ruby21-x64\bin
         - C:\Users\mypc\AppData\Local\Microsoft\WindowsApps

0 个答案:

没有答案