我无法使用Windows XP的ruby开发工具包 [英] I can't get the ruby development kit working for Windows XP

查看:110
本文介绍了我无法使用Windows XP的ruby开发工具包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以,我不能为了我的生活正常工作。我的最终目标是安装并运行dbd-odbc gem,并且从我读过的多个东西中,我需要安装 ODBC绑定与dbd-odbc gem一起使用。那么,我可以安装dbd-odbc gem,但是当试图安装绑定时,它像我这样对坦克进行安装:

 
构建本地扩展。这可能需要一段时间...
错误:安装ruby-odbc-0.9998.gem时出错:
错误:未能构建gem原生扩展。

c:/ tools / ruby / ruby​​-1.9.1 -p376 / bin / ruby​​.exe extconf.rb
检查version.h ... *** extconf.rb失败***
无法创建Makefile,原因是某些原因,可能缺少
必要的库和/或标题。查看mkmf.log文件以获取更多
的详细信息。您可能需要配置选项。

提供的配置选项:
--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
--srcdir =。
--curdir
--ruby = c:/tools/ruby/ruby-1.9.1-p376/bin/ruby
--with-odbc-dir
- 无 - odbc-dir
--with-odbc-include
--without-odbc-include = $ {odbc-dir} / include
--with-odbc-lib
--without-odbc-lib = $ {odbc-dir} / lib
c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:364:in 'try_do':编译器未能生成可执行文件。 (RuntimeError)
您必须先安装开发工具。
from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:433:在'try_cpp'
from c:/ tools / ruby​​ / ruby-1.9.1-p376 / lib / ruby​​ / 1.9.1 / mkmf.rb:811:'block in have_header'
from c:/tools/ruby/ruby-1.9.1-p376/lib/ ruby / 1.9.1 / mkmf.rb:670:在'block in checking_for'
from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb: 276:在'block(2 levels)'中推迟'
from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:250:在'open'
from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:276:在'block in postpone'
from c:/ tools / ruby / ruby​​-1.9.1-p376 / lib / ruby​​ / 1.9.1 / mkmf.rb:250:在'open'中
从c:/tools/ruby/ruby-1.9.1-p376/lib/ ruby / 1.9.1 / mkmf.rb:272:在'推迟'
从c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:669:在'checking_for'
from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:810:'have_header'
from extconf.rb:22:在''

所以...通读它,它说我必须先安装开发工具。精致和华丽。我去这里,抓住开发工具包。我在此处漫步,并阅读有关如何安装它的说明。我安装它。

在附注中 - 我已经从ruby安装程序站点通过1.9.1的一键安装来尝试此操作。我已经试过用预编译的mswin-32的红宝石二进制文件,在1.8.6,1.8.7和1.9.1下。他们都没有工作。

我会坚持使用一键安装程序,因为这是我通过网络浏览的所有说明似乎正在使用。精细。它说要编辑我的fstab文件。我做。这是我目前的设置:

我的ruby安装位于: C:\ tools \ ruby​​\\\ ruby​​19 devkit已经被解压目录,我可以检查/ bin并在那里看到gcc.bat,make.bat和sh.bat。

我按照指示修改我的devkit / msys / 1.0.11 / etc / fstab文件。现在看起来像这样:

C:/tools/ruby/ruby19/devkit/gcc/3.4.5/mingw
C:/ tools / ruby​​ / ruby​​19 / devkit / msys / 1.0.11 / usr / local / usr / local



无论我看起来如何做,我都无法享受生活的我得到odbc绑定gem编译为本机扩展。我不断得到同样的错误。这是非常令人沮丧的 - 请帮助!

解决方案




对于Win32操作系统,
0.997的DLL可在i386-msvcrt-ruby-odbc.zip中找到。它包含
文件odbc.so和odbc_utf8.so
,它们需要被复制到

/ ruby​​ / 1.8 / i386-msvcrt目录中。基于MSVC的Ruby 1.8安装。


尝试将这些文件放在建议的位置,然后安装该版本的gem,并查看它是如何发生的。


So, I can't for the life of my get this working properly. My ultimate goal is to get the dbd-odbc gem installed and working, and from multiple things I've read, I need to install the ODBC binding for ruby alongside the dbd-odbc gem. Well, I can get the dbd-odbc gem installed just fine, but when it comes to trying to install the binding it tanks out on me like so:

Building native extensions.  This could take a while...
ERROR:  Error installing ruby-odbc-0.9998.gem:
        ERROR: Failed to build gem native extension.`

c:/tools/ruby/ruby-1.9.1-p376/bin/ruby.exe extconf.rb
checking for version.h... *** 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
        --srcdir=.
        --curdir
        --ruby=c:/tools/ruby/ruby-1.9.1-p376/bin/ruby
        --with-odbc-dir
        --without-odbc-dir
        --with-odbc-include
        --without-odbc-include=${odbc-dir}/include
        --with-odbc-lib
        --without-odbc-lib=${odbc-dir}/lib
c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:364:in 'try_do': The complier failed to generate an executable file. (RuntimeError)  
You have to install development tools first.  
        from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:433:in 'try_cpp'
        from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:811:in 'block in have_header'
        from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:670:in 'block in checking_for'
        from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:276:in 'block (2 levels) in postpone'
        from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:250:in 'open'
        from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:276:in 'block in postpone'
        from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:250:in 'open'
        from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:272:in 'postpone'
        from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:669:in 'checking_for'
        from c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:810:in 'have_header'
        from extconf.rb:22:in ''

So...reading through it, it says I have to install the development tools first. Fine and dandy. I go here, and grab the dev kit. I wander here, and read through the instructions on how to install it. I install it.
On a side note - I've tried this with a one-click install of 1.9.1 from the ruby installer site. I've tried this with precompiled mswin-32 binaries of ruby, under 1.8.6, 1.8.7 and 1.9.1. None of them have worked.
I'll stick with the one-click installer since that's what all the instructions I've come across the web seem to be using. Fine. It says to edit my fstab file. I do. Here's my current setup:
My ruby installation is sitting in: C:\tools\ruby\ruby19 The devkit has been extracted into this directory, and I can check the /bin and see gcc.bat, make.bat and sh.bat in there.
I follow the directions and modify my devkit/msys/1.0.11/etc/fstab file. It now looks like this:
C:/tools/ruby/ruby19/devkit/gcc/3.4.5 /mingw C:/tools/ruby/ruby19/devkit/msys/1.0.11/usr/local /usr/local

No matter what I seem to do, I cannot for the life of me get the odbc binding gem to compile to native extensions. I keep getting the same error over and over. This is getting highly frustrating - please help!

解决方案

You're killing yourself.

For Win32 operating systems DLLs of 0.997 are available in i386-msvcrt-ruby-odbc.zip. It contains the files odbc.so and odbc_utf8.so which need to be copied into the .../ruby/1.8/i386-msvcrt directory of MSVC based Ruby 1.8 installations.

Try putting those files where recommended, then installing that version of the gem, and see how it goes.

这篇关于我无法使用Windows XP的ruby开发工具包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆