无法在Windows Ruby 1.9.2上安装或更新Ruby bluecloth gem [英] Unable to install or update Ruby bluecloth gem on Windows Ruby 1.9.2

查看:177
本文介绍了无法在Windows Ruby 1.9.2上安装或更新Ruby bluecloth gem的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

试图在Windows上更新我的bluecloth gem版本时收到错误消息。是否有需要为Windows安装的另一个版本,或者我可以使用的另一种蓝色布料?不幸的是,由于我使用的其他软件,我的开发环境严格为Windows,否则我会使用Linux环境。



以下是我得到的复制粘贴:


C:\Users\Developer1> gem update

更新已安装的宝石

更新bluecloth

暂时增强PATH以包含DevKit ...

构建原生扩展。这可能需要一段时间...

错误:安装bluecloth时出错:

错误:无法生成gem本机扩展。



C:/Ruby192/bin/ruby.exe extconf.rb

检查srand()...是

检查random()... no

检查rand()...是

检查string.h中的bzero(),strings.h ...不检查
检查strcasecmp()。 ..是的
检查strncasecmp()...是

检查mkdio.h ...是

检查ruby / encoding.h。 ..是的

创建extconf.h

创建Makefile




C:/ Ruby192 / bin / ruby -e放入'EXPORTS','Init_bluecloth_ext'> bluecloth_ext-i386-mingw32.def
gcc -I。 -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I / C / Ruby192 / include / ruby​​-1

.9.1 / ruby​​ / backward -I / C / Ruby192 / include /ruby-1.9.1 -I。 -DRUBY_EXTCONF_H = \extconf.h\-DVERSION = \2.0.9 \-O3 -g -Wextra -Wno -unused-parameter -Wno-brackheses -Wpointer-arith -Wwrite-strings -Wno -missing-field-initializers -Wno-long-long -I。 -o bluecloth.o -c bluecloth.c

从c:\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ ../ ..

/../include/windows.h:48:0,

from c:\ruby-devkit\mingw\bin ../ lib / gcc / mingw32 / 4.5.2 /../../ ..

/../include/winsock2.h:22,

from c:/ Ruby192 / include / ruby​​-1.9.1 / ruby​​ / win32.h:33,

from c:/Ruby192/include/ruby-1.9.1/ruby/defines.h:205,
$ b $ c from:/Ruby192/include/ruby-1.9.1/ruby/ruby.h:74,

from c:/Ruby192/include/ruby-1.9.1/ruby.h:32 ,
bluecloth.h:14,

from bluecloth.c:25:

c:\ruby-devkit\mingw\bin .. /lib/gcc/mingw32/4.5.2/../../../../include/windef.h:2

29:23:错误:重复的'unsigned'

C:\ruby-devkit\mingw\bin ../ LIB / GCC /的mingw32 / 4.5.2 /../../../../包括/ WINDEF.H:2

38:23:错误:重复'unsigned'

c:\ruby-devkit\mingw\bin ../ lib / gcc / mingw32 / 4.5.2 /../../../../include/windef.h:2

38:23:错误:声明说明符中有两个或多个数据类型

c:\\ \\ruby-devkit \\\\\\\\\\\ ../ lib / gcc / mingw32 / 4.5.2 /../../../../include/windef.h:2

41 :24:error:重复'unsigned'

$ b $ make: * [bluecloth.o]错误1



Gem文件将继续安装在C:/Ruby192/lib/ruby/gems/1.9.1/gems/bluecloth-2.2.0中进行检查。
记录到C的结果:/Ruby192/lib/ruby/gems/1.9.1/gems/bluecloth-2.2.0/ext/gem_make.out
无需更新



解决方案

2.2.0中的头文件可防止在Windows上编译bluecloth。但是,您可以自行修补它。正如Luis Lavena提到的那样,您需要应用该路径。


  1. 运行 gem install bluecloth -v' 2.2.0'如果您还没有

  2. 应用此修补程序 bluecloth.h 文件中,位于我的计算机上



    H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\ext\bluecloth.h


  3. 转至Bluecloth 2.2.0目录,例如

    H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0


  4. 运行 rake gem (这可能需要安装一些额外的宝石)



    然后您应该看到在

    中创建的.gem文件
    $ b $ p $ H $ \Ruby193\lib\ruby\gems\1.9.1 \gems\bluecloth-2.2.0\pkg\bluecloth-2.2.0.gem


  5. 打开这个d irectory并安装修补后的gem:

    gem install bluecloth-2.2.0.gem --platform = ruby​​



I'm getting an error message while trying to update my version of bluecloth gem on Windows. Is there a different version that I need to install for Windows or an alternative to bluecloth that I can use? Unfortunately my development environment is strictly Windows due to other software I work with, otherwise I'd use a Linux environment.

Here's a copy paste of what I get:

C:\Users\Developer1>gem update
Updating installed gems
Updating bluecloth
Temporarily enhancing PATH to include DevKit...
Building native extensions. This could take a while...
ERROR: Error installing bluecloth:
ERROR: Failed to build gem native extension.

C:/Ruby192/bin/ruby.exe extconf.rb
checking for srand()... yes
checking for random()... no
checking for rand()... yes
checking for bzero() in string.h,strings.h... no
checking for strcasecmp()... yes
checking for strncasecmp()... yes
checking for mkdio.h... yes
checking for ruby/encoding.h... yes
creating extconf.h
creating Makefile

make C:/Ruby192/bin/ruby -e "puts 'EXPORTS', 'Init_bluecloth_ext'" > bluecloth_ext-i386-mingw32.def gcc -I. -IC:/Ruby192/include/ruby-1.9.1/i386-mingw32 -I/C/Ruby192/include/ruby-1
.9.1/ruby/backward -I/C/Ruby192/include/ruby-1.9.1 -I. -DRUBY_EXTCONF_H=\"extconf.h\" -DVERSION=\"2.0.9\" -O3 -g -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wno-long-long -I. -o bluecloth.o -c bluecloth.c
In file included from c:\ruby-devkit\mingw\bin../lib/gcc/mingw32/4.5.2/../../..
/../include/windows.h:48:0,
from c:\ruby-devkit\mingw\bin../lib/gcc/mingw32/4.5.2/../../..
/../include/winsock2.h:22,
from c:/Ruby192/include/ruby-1.9.1/ruby/win32.h:33,
from c:/Ruby192/include/ruby-1.9.1/ruby/defines.h:205,
from c:/Ruby192/include/ruby-1.9.1/ruby/ruby.h:74,
from c:/Ruby192/include/ruby-1.9.1/ruby.h:32,
from bluecloth.h:14,
from bluecloth.c:25:
c:\ruby-devkit\mingw\bin../lib/gcc/mingw32/4.5.2/../../../../include/windef.h:2
29:23: error: duplicate 'unsigned'
c:\ruby-devkit\mingw\bin../lib/gcc/mingw32/4.5.2/../../../../include/windef.h:2
38:23: error: duplicate 'unsigned'
c:\ruby-devkit\mingw\bin../lib/gcc/mingw32/4.5.2/../../../../include/windef.h:2
38:23: error: two or more data types in declaration specifiers
c:\ruby-devkit\mingw\bin../lib/gcc/mingw32/4.5.2/../../../../include/windef.h:2
41:24: error: duplicate 'unsigned'
make: * [bluecloth.o] Error 1

Gem files will remain installed in C:/Ruby192/lib/ruby/gems/1.9.1/gems/bluecloth-2.2.0 for inspection. Results logged to C:/Ruby192/lib/ruby/gems/1.9.1/gems/bluecloth-2.2.0/ext/gem_make.out Nothing to update

解决方案

The header files in 2.2.0 prevents bluecloth from compile on windows. However, you can patch it by yourself. As Luis Lavena mentioned, you need to apply the path.

  1. Run gem install bluecloth -v '2.2.0' if you haven't already

  2. Apply this patch on bluecloth.h file, on my machine it is located in

    H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\ext\bluecloth.h

  3. Go to bluecloth 2.2.0 directory, for example

    H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0

  4. Run rake gem (this may require to install some additional gems).

    Then you should see .gem file created in

    H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\pkg\bluecloth-2.2.0.gem

  5. Open this directory and install the patched gem:

    gem install bluecloth-2.2.0.gem --platform=ruby

这篇关于无法在Windows Ruby 1.9.2上安装或更新Ruby bluecloth gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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