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

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

问题描述

所以,我这辈子都无法正常工作.我的最终目标是安装 dbd-odbc gem 并使其正常工作,从我读过的很多内容来看,我需要安装 ODBC 绑定 用于 ruby​​ 和 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--没有选择目录--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}/libc:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:364:in 'try_do': 编译器无法生成可执行文件.(运行时错误)您必须先安装开发工具.来自 c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:433:in 'try_cpp'来自 c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:811:in 'block in have_header'来自 c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:670:in 'block in checks_for'来自 c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:276:in 'block (2 levels) in delay'来自 c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:250:in 'open'来自 c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:276:in 'block in delay'来自 c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:250:in 'open'来自 c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:272:in 'postpone'来自 c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:669:in 'checking_for'来自 c:/tools/ruby/ruby-1.9.1-p376/lib/ruby/1.9.1/mkmf.rb:810:in 'have_header'来自 extconf.rb:22:in ''

所以...通读它,它说我必须先安装开发工具.很好很花花公子.我去这里,获取开发工具包.我在 此处 徘徊,并通读了有关如何安装它的说明.我安装它.
附带说明 - 我已经通过 ruby​​ 安装程序站点的一键安装 1.9.1 进行了尝试.我已经在 1.8.6、1.8.7 和 1.9.1 下使用预编译的 mswin-32 ruby​​ 二进制文件进行了尝试.他们都没有工作.
我会坚持使用一键安装程序,因为我在网上看到的所有说明似乎都在使用它.美好的.它说要编辑我的 fstab 文件.我做.这是我当前的设置:
我的ruby安装在:C:\tools\ruby\ruby19 devkit已经解压到这个目录下,可以查看/bin,看到gcc.bat,make.bat,sh.蝙蝠在那里.
我按照指示修改我的 devkit/msys/1.0.11/etc/fstab 文件.现在看起来像这样:
<代码>C:/tools/ruby/ruby19/devkit/gcc/3.4.5/mingwC:/tools/ruby/ruby19/devkit/msys/1.0.11/usr/local/usr/local

无论我似乎做什么,我一生都无法将 odbc 绑定 gem 编译为本地扩展.我一遍又一遍地得到同样的错误.这令人非常沮丧 - 请帮忙!

解决方案

你是在害自己.

<块引用>

对于 Win32 操作系统的 DLL0.997 在 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.

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

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