在Windows上为Jekyll安装本地Ruby扩展 [英] Installing native Ruby extensions on Windows for Jekyll

查看:105
本文介绍了在Windows上为Jekyll安装本地Ruby扩展的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在这里疯了,所以我只会问:



你怎么在Windows上安装Ruby Gem Jekyll?



Jekyll依赖于fast-stemmer-1.0.0,并且必须构建为本地扩展



我发现这个方便在 RubyDevKit 上指导您在Windows上安装'理智'的环境,它可以工作,但fast-stemmer仍然想用nmake来构建二进制文件,并返回以下错误:

  C:\Program文件(x86)\ Microsoft Visual Studio 10.0 \ VC> gem install jekyll 
临时增强PATH以包含DevKit ...
构建本机扩展。这可能需要一段时间...
错误:安装jekyll时出错:
错误:无法构建gem本机扩展。

C:/Ruby/bin/ruby.exe extconf.rb
创建Makefile

nmake

Microsoft(R)程序维护Utility版本10.00.30319.01
版权所有(C)Microsoft Corporation。版权所有。

cl -nologo -I。 -IC:/Ruby/lib/ruby/1.8/i386-mswin32 -IC:/ Ruby / lib / ruby​​ / 1。
8 / i386-mswin32 -I。 -MD -Zi -O2b2xg- -G6 -c -Tcporter.c
cl:命令行警告D9035:选项'Og-'已被弃用,并将在未来的发行版中变为r

cl:命令行警告D9002:忽略未知选项'-G6'
porter.c
porter.c(31):致命错误C1083:无法打开包含文件:'stdlib.h':没有这样的
文件或目录
NMAKE:致命错误U1077:'C:\程序文件(x86)\ Microsoft Visual Studio 10.0
\ VC\BIN\cl.EXE ':返回码'0x2'
停止。


Gem文件将保留安装在C:/Ruby/lib/ruby/gems/1.8/gems/fast-stemmer-1-1b $ b.0.0中进行检查。
记录到C的结果:/Ruby/lib/ruby/gems/1.8/gems/fast-stemmer-1.0.0/ext/gem_make
.out

我使用C:\ Program Files(x86)中的Visual Studio 2010附带的nmake \ Microsoft Visual Studio 10.0 \ VC \\正如其他一些条款中所建议的那样。但它仍然无效。



我试着从DevKit附带的MSYS shell中运行gem install,所以我确实在那时使用了Unix ,但我不知道如何指示Ruby使用make而不是nmake(并且读取mkmf.rb也没有启发我)。它非常喜欢使用nmake,并且与上面的错误消息相比,失败很多。



任何帮助都将不胜感激!



更新
我终于意识到我没有通过RubyInstaller.org安装Ruby。我使用安装程序重新安装,现在使用DevKit构建jekyll可以正常工作。



感谢大家指出这一点!

与您所遵循的说明混淆。 RubyInstaller DevKit中的指令是为支持使用RubyInstaller编译版本的Ruby安装扩展而创建的。

显然,从当前目录(visual studio)和输出您使用的基于Ruby的gem安装 mswin32 ,它不适用于RubyInstaller或我们记录的DevKit。



请从 RubyInstaller 网站安装Ruby和DevKit,并按照其中的说明操作并避免与Visual Studio混合 strong>


I'm about to go crazy here so I'll just ask:

How the hell do you install the Ruby Gem Jekyll on Windows.

Jekyll depends on fast-stemmer-1.0.0 and that has to be built as a native extension

I found this handy guide on RubyDevKit to install a 'sane' environment on Windows and it works, but fast-stemmer is still hell bent on using nmake to build the binaries and that returns the following error:

C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC>gem install jekyll
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing jekyll:
        ERROR: Failed to build gem native extension.

C:/Ruby/bin/ruby.exe extconf.rb
creating Makefile

nmake

Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation.  All rights reserved.

        cl -nologo -I. -IC:/Ruby/lib/ruby/1.8/i386-mswin32 -IC:/Ruby/lib/ruby/1.
8/i386-mswin32 -I. -MD -Zi -O2b2xg- -G6  -c -Tcporter.c
cl : Command line warning D9035 : option 'Og-' has been deprecated and will be r
emoved in a future release
cl : Command line warning D9002 : ignoring unknown option '-G6'
porter.c
porter.c(31) : fatal error C1083: Cannot open include file: 'stdlib.h': No such
file or directory
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\cl.EXE"' : return code '0x2'
Stop.


Gem files will remain installed in C:/Ruby/lib/ruby/gems/1.8/gems/fast-stemmer-1
.0.0 for inspection.
Results logged to C:/Ruby/lib/ruby/gems/1.8/gems/fast-stemmer-1.0.0/ext/gem_make
.out

I'm using the nmake that came with Visual Studio 2010 in C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\bin as suggested in some other Article. But it still doesn't work.

I've tried running the gem install from the MSYS shell that comes with the DevKit so I do have the Unix make at that point, but I don't know how to instruct Ruby to use make instead of nmake (and reading the mkmf.rb didn't enlighten me either). It's hell bent on using nmake and that fails pretty with the above error message

Any help on this would be greatly appreciated!

Update I finally realized that I had not installed Ruby through RubyInstaller.org. I reinstalled using the Installer and now building jekyll with the DevKit works fine.

Thanks to everyone for pointing that out!

解决方案

There is a confusion with the instructions you're following. The instructions at RubyInstaller DevKit were created to support installation of extensions using RubyInstaller compiled versions of Ruby.

It is clear, from your current directory (visual studio) and the output of the gem installation you're using mswin32 based Ruby, which will not work with RubyInstaller or the DevKit we documented.

Please install Ruby and the DevKit from RubyInstaller website and follow the instructions there and avoid mixing with Visual Studio

这篇关于在Windows上为Jekyll安装本地Ruby扩展的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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