无法在Windows Ruby 1.9.2上安装或更新Ruby bluecloth gem [英] Unable to install or update Ruby bluecloth gem on Windows Ruby 1.9.2
问题描述
以下是我得到的复制粘贴:
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提到的那样,您需要应用该路径。
-
运行
gem install bluecloth -v' 2.2.0'
如果您还没有 -
应用此修补程序在
bluecloth.h
文件中,位于我的计算机上
H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\ext\bluecloth.h
-
转至Bluecloth 2.2.0目录,例如
H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0
-
运行
rake gem
(这可能需要安装一些额外的宝石)
然后您应该看到在
中创建的.gem文件
$ b $ p $ H $ \Ruby193\lib\ruby\gems\1.9.1 \gems\bluecloth-2.2.0\pkg\bluecloth-2.2.0.gem -
打开这个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 Makefilemake 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 1Gem 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.
Run
gem install bluecloth -v '2.2.0'
if you haven't alreadyApply this patch on
bluecloth.h
file, on my machine it is located inH:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\ext\bluecloth.h
Go to bluecloth 2.2.0 directory, for example
H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0
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
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屋!