Windows上没有安装Teradata-cli ruby​​ gem

时间:2016-06-30 05:46:32

标签: ruby rubygems teradata

我正在尝试使用ruby脚本连接到Teradata,我需要teradata-cli ruby​​ gem。但是gem没有安装,并且出现以下错误:

  

gem install teradata-cli

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

    C:/Vendor/ruby-2.0.0-p451/bin/ruby.exe extconf.rb
checking for ruby.h... yes
checking for main() in -lwincli32... no
*** 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:/Vendor/ruby-2.0.0-p451/bin/ruby
        --with-cli-dir
        --without-cli-dir
        --with-cli-include
        --without-cli-include=${cli-dir}/include
        --with-cli-lib
        --without-cli-lib=${cli-dir}/
        --with-wincli32lib
        --without-wincli32lib

extconf failed, exit code 1

Gem files will remain installed in C:/Vendor/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/teradata-cli-0.0.12 for inspection.
Results logged to C:/Vendor/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/extensions/x86-mingw32/2.0.0/teradata-cli-0.0.12/gem_make.out

要解决上述问题,我在我的机器上安装了cliv2,并再次尝试按如下方式安装gem:

  

gem install teradata-cli - ' - with-cli-lib =" C:\ Teradata_cliv2_x64 \ Teradata \ Client \ 14.00 \ CLIv2 \ lib" --with-CLI-包括=" C:\ Teradata_cliv2_x64 \ Teradata的\客户\ 14.00 \ CLIv2 \ INC"'

其中lib和include是安装Cliv2客户端的目录。

现在不会抛出上面显示的错误,但会显示以下错误:

C:/Vendor/ruby-2.0.0-p451/bin/ruby.exe extconf.rb --with-cli-lib="C:\Teradata_cliv2_x64\Teradata\Client\14.00\CLIv2\lib" --with-cli-in
de="C:\Teradata_cliv2_x64\Teradata\Client\14.00\CLIv2\inc"
checking for ruby.h... yes
checking for main() in -lwincli32... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
generating cli-i386-mingw32.def
compiling cli.c
cli.c: In function 'status_name':
cli.c:269:17: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:270:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:271:19: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:272:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:273:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:274:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:275:24: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:276:21: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:277:23: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:278:24: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:279:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:280:26: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:281:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:282:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:283:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:284:21: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:285:21: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:286:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:287:21: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c: In function 'flavor_name':
cli.c:308:18: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:309:25: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:310:19: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:311:19: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:312:23: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:313:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:314:21: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:315:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:316:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:317:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:318:21: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:319:27: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:320:25: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:321:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:322:27: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:323:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:324:24: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:325:17: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:326:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:327:24: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:328:20: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:329:21: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:330:23: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:331:22: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:332:23: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:333:24: warning: return discards 'const' qualifier from pointer target type [enabled by default]
cli.c:334:19: warning: return discards 'const' qualifier from pointer target type [enabled by default]
In file included from cli.c:20:0:
cli.c: At top level:
C:\Teradata_cliv2_x64\Teradata\Client\14.00\CLIv2\inc/dbcarea.h:270:13: warning: 'D8XIIIRX' defined but not used [-Wunused-variable]
linking shared-object teradata-cli/cli.so
cli.o: In function `logoff':
C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:172: undefined reference to `DBCHCL@12'
cli.o: In function `cli_cleanup':
C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:194: undefined reference to `DBCHCLN@8'
cli.o: In function `cli_initialize':
C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:100: undefined reference to `DBCHINI@12'
cli.o: In function `dispatch':
C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:258: undefined reference to `DBCHCL@12'
cli.o: In function `logoff':
C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:172: undefined reference to `DBCHCL@12'
cli.o: In function `dispatch':
C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:258: undefined reference to `DBCHCL@12'
C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:258: undefined reference to `DBCHCL@12'
C:\Vendor\ruby-2.0.0-p451\lib\ruby\gems\2.0.0\gems\teradata-cli-0.0.12\ext\teradata-cli\cli/cli.c:258: undefined reference to `DBCHCL@12'
collect2.exe: error: ld returned 1 exit status
make: *** [cli.so] Error 1

make failed, exit code 2

Gem files will remain installed in C:/Vendor/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/gems/teradata-cli-0.0.12 for inspection.
Results logged to C:/Vendor/ruby-2.0.0-p451/lib/ruby/gems/2.0.0/extensions/x86-mingw32/2.0.0/teradata-cli-0.0.12/gem_make.out

请指导如何解决此问题。

1 个答案:

答案 0 :(得分:0)

使用以下命令成功安装了teradata-cli:

gem install teradata-cli -- '--with-cli-lib="C:\TeradataCliv2_x86\Teradata\Client\15.10\CLIv2\lib" --with-cli-include="C:\TeradataCliv2_x86\Teradata\Client\15.10\CLIv2\inc"'

其中lib和include是安装cliv2客户端的路径。

问题在于cliv2客户端与我的ruby版本不兼容,一旦我安装了兼容的cliv2客户端,gem就成功安装了。