首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >使用包安装安装Publify时,在bluecloth gem上出错

使用包安装安装Publify时,在bluecloth gem上出错
EN

Stack Overflow用户
提问于 2012-01-13 16:50:22
回答 2查看 1.5K关注 0票数 5

我正在尝试为Windows上的Ruby on Rails 3.1安装Publify web blog CMS 6.0.9。

每次我尝试bundle install Publify时,在安装bluecloth gem时都会得到相同的错误信息:

代码语言:javascript
复制
C:\Users\Lunasea\Downloads\typo-6.0.9>gem install 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:/RailsInstaller/Ruby1.9.2/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:/RailsInstaller/Ruby1.9.2/bin/ruby -e "puts 'EXPORTS', 'Init_bluecloth_ext'"
> bluecloth_ext-i386-mingw32.def
gcc -I. -IC:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/i386-mingw32 -I/C/Rails
Installer/Ruby1.9.2/include/ruby-1.9.1/ruby/backward -I/C/RailsInstaller/Ruby1.9
.2/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-st
rings -Wno-missing-field-initializers -Wno-long-long -I.  -o bluecloth.o -c blue
cloth.c
In file included from c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.
1/../../../../include/windows.h:48:0,
                 from c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.
1/../../../../include/winsock2.h:22,
                 from c:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/win32.
h:33,
                 from c:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/define
s.h:205,
                 from c:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby/ruby.h
:74,
                 from c:/RailsInstaller/Ruby1.9.2/include/ruby-1.9.1/ruby.h:32,
                 from bluecloth.h:14,
                 from bluecloth.c:25:
c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:229:23: error: duplicate 'unsigned'
c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:238:23: error: duplicate 'unsigned'
c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:238:23: error: two or more data types in declaration specifiers
c:\railsinstaller\devkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:241:24: error: duplicate 'unsigned'
make: *** [bluecloth.o] Error 1


Gem files will remain installed in C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9
.1/gems/bluecloth-2.2.0 for inspection.
Results logged to C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/gems/bluecloth
-2.2.0/ext/gem_make.out

我已经尝试单独安装gem,或者只是简单地安装最新版本,但它总是得到相同的结果。

我使用的是标准生成的database.yml。

EN

回答 2

Stack Overflow用户

发布于 2012-11-25 02:12:50

2.2.0中的头文件阻止了在windows上编译bluecloth。但是,您可以自己修补它:

  1. 运行gem install bluecloth -v '2.2.0'如果您尚未
  2. Apply this patch on bluecloth.h文件,在我的计算机上,该文件位于

到bluecloth 2.2.0目录的H:\Ruby193\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\ext\bluecloth.h

  • Go,例如

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

  • Run rake gem (这可能需要安装一些额外的gem)。

然后,您应该会看到在中创建了.gem文件

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

  • Open此目录并安装修补的gem:

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

票数 5
EN

Stack Overflow用户

发布于 2012-01-13 17:05:36

Windows不是运行rails的最佳环境。这是一个很好的例子。有关详细信息,请参阅this link

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8847969

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档