首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >如何在Windows上安装RedCloth?

如何在Windows上安装RedCloth?
EN

Stack Overflow用户
提问于 2011-09-03 10:58:53
回答 2查看 2.9K关注 0票数 11

当运行gem install RedCloth (在Windows XP上)时,我得到:

代码语言:javascript
复制
Fetching: RedCloth-4.2.8.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Successfully installed RedCloth-4.2.8
1 gem installed
Installing ri documentation for RedCloth-4.2.8...
Installing RDoc documentation for RedCloth-4.2.8...
ERROR:  While generating documentation for RedCloth-4.2.8
... MESSAGE:   error generating index.html: Error while evaluating D:/Programs/R
uby/lib/ruby/gems/1.9.1/gems/rdoc-3.9/lib/rdoc/generator/template/darkfish/index
.rhtml: undefined method `[]' for nil:NilClass (RDoc::Error)
... RDOC args: --op D:/Programs/Ruby/lib/ruby/gems/1.9.1/doc/RedCloth-4.2.8/rdoc
 --charset=UTF-8 --line-numbers --title RedCloth --main README.rdoc lib lib/case
_sensitive_require ext README.rdoc COPYING CHANGELOG --title RedCloth-4.2.8 Docu
mentation --quiet

为什么会出现这个错误?

然后我将require 'RedCloth'添加到config/environment.rb中,并尝试运行rails s,但不幸的是,我得到了:

代码语言:javascript
复制
D:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.8/lib/redcloth.rb:12:in `
require': no such file to load -- 1.9/redcloth_scan (LoadError)
Couldn't load 1.9/redcloth_scan
The $LOAD_PATH was: ...

我做错了什么?

我使用的是Rails 3.0.1,Ruby 1.9.2。

代码语言:javascript
复制
bundle show RedCloth

=> D:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.8
EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2011-09-05 23:12:47

这是我对你的第二个错误的解决办法,“无法加载1.9/ RedCloth _scan",它看起来像是Windows上的RedCloth的错误。在gem install RedCloth --no-rdoc之后,我运行

代码语言:javascript
复制
cd c:\Ruby192\lib\ruby\gems\1.9.1\gems\RedCloth-4.2.8\lib
mkdir 1.9
copy redcloth_scan.so 1.9

您应该用您的路径替换该目录,当然是"D:\Programs\Ruby\lib\ruby\gems\1.9.1\gems\RedCloth-4.2.8\lib",。

票数 13
EN

Stack Overflow用户

发布于 2015-09-08 09:41:54

请确保根据错误消息命名目录。例如,对于Ruby 2.1和

代码语言:javascript
复制
LoadError: cannot load such file -- 2.1/redcloth_scan

用户应该在"lib“目录中创建目录"2.1",并将redcloth_scan.so复制到其中

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

https://stackoverflow.com/questions/7290868

复制
相关文章

相似问题

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