gpt4 book ai didi

ruby-on-rails - Bluecloth v2.0.10 与 Windows 7 不工作

转载 作者:数据小太阳 更新时间:2023-10-29 06:56:09 26 4
gpt4 key购买 nike

使用 Ruby 187,我从 http://rubyinstaller.org/downloads 下载了 devkit并按照 https://github.com/oneclick/rubyinstaller/wiki/Development-Kit 的说明进行操作.我还确保通过以下方式正确安装了 devkit冒烟测试。

然后我尝试安装 bluecloth (v2.0.10)。它失败了以下错误:

C:\test\typo>gem install bluecloth --platform=ruby

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:/Ruby187/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... no
creating extconf.h
creating Makefile

make
gcc -I. -I. -Ic:/Ruby187/lib/ruby/1.8/i386-mingw32 -I. -
DRUBY_EXTCONF_H=\"extcon
f.h\" -DVERSION=\"2.0.4\" -g -O2 -DFD_SETSIZE=256 -I. -Wall -c
bluecloth.c

In file included from c:\rubydevkit\mingw\bin\../lib/gcc/
mingw32/4.5.1/../../../../include/windows.h:48:0,
from c:\rubydevkit\mingw\bin\../lib/gcc/
mingw32/4.5.1/../../../../include/winsock2.h:22,
from c:/Ruby187/lib/ruby/1.8/i386-mingw32/win32/
win32.h:27,
from c:/Ruby187/lib/ruby/1.8/i386-mingw32/defines.h:
186,
from c:/Ruby187/lib/ruby/1.8/i386-mingw32/ruby.h:37,
from bluecloth.h:14,
from bluecloth.c:25:
c:\rubydevkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:229:23: error: duplicate 'unsigned'
c:\rubydevkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:238:23: error: duplicate 'unsigned'
c:\rubydevkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:238:23: error: two or more data types in declaration
specifiers
c:\rubydevkit\mingw\bin\../lib/gcc/mingw32/4.5.1/../../../../include/
windef.h:241:24: error: duplicate 'unsigned'
bluecloth.c: In function 'bluecloth_initialize':
bluecloth.c:190:9: warning: unused variable 'utf8text'
make: *** [bluecloth.o] Error 1

Gem files will remain installed in c:/Ruby187/lib/ruby/gems/1.8/gems/
bluecloth-2.0.10 for inspection.
Results logged to c:/Ruby187/lib/ruby/gems/1.8/gems/bluecloth-2.0.10/
ext/gem_make.out

C:\test\typo>

最佳答案

如果您需要 2.2.0(最新版本),下面是我如何让它工作的:

  1. 安装 DevKit

  2. 运行以下命令安装 bluecloth:

    gem 安装 bluecloth

    这在构建“ native 扩展”时会惨败,但会成功安装 gem 的源代码。

  3. 补丁 bluecloth.h 文件(对我来说,它位于:D:\ruby\Ruby-1.9.3-p125\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\ext),补丁来自这里:https://gist.github.com/1539611

  4. 转到 bluecloth 的 gem 安装文件夹。对我来说,这看起来像下面这样:

    D:\ruby\Ruby-1.9.3-p125\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0

  5. 运行以下命令:

    rake gem

    它可能会提示您安装一些其他的 gem,请按照相应的步骤进行操作。完成后,您应该会看到创建了一个 bluecloth-2.2.0.gem。对我来说,它可以在这里找到:

    D:\ruby\Ruby-1.9.3-p125\lib\ruby\gems\1.9.1\gems\bluecloth-2.2.0\pkg\bluecloth-2.2.0.gem

  6. 转到 bluecloth-2.2.0.gem 位置,然后运行以下命令:

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

关于ruby-on-rails - Bluecloth v2.0.10 与 Windows 7 不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4932221/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com