如何在Windows上安装RedCloth? [英] How to install RedCloth on Windows?
问题描述
运行 gem install RedCloth
(在Windows XP上)我得到了:
获取:RedCloth-4.2.8.gem(100%)
暂时增强PATH以包含DevKit ...
构建本机扩展。这可能需要一段时间...
成功安装RedCloth-4.2.8
1个安装gem
为RedCloth-4.2.8安装ri文档...
安装RDoc文档RedCloth-4.2.8 ...
错误:在为RedCloth-4.2.8
生成文档时... MESSAGE:错误生成index.html:评估D时出错:/ Programs / R
ilby / lib / ruby / gems / 1.9.1 / gems / rdoc-3.9 / lib / rdoc / generator / template / darkfish / index
.rhtml:未定义方法`[]'为nil:NilClass(RDoc: :错误)
... RDOC参数:--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
,但unfo幸运的是:
D:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/RedCloth-4.2 .8 / lib / redcloth.rb:12:在`
require'中:无需加载此文件 - 1.9 / redcloth_scan(LoadError)
无法加载1.9 / redcloth_scan
$ LOAD_PATH是:...
我做错了什么?
我使用Rails 3.0.1,Ruby 1.9.2。
bundle show RedCloth
=> D:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.8
这是我的第二个错误,无法加载1.9 / redcloth_scan的解决方法,它看起来像Windows上的RedCloth的bug。在> gem install RedCloth --no-rdoc
后,我运行
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 \当然\1.9.1\gems\RedCloth-4.2.8\lib。
When running gem install RedCloth
(on Windows XP) I got:
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
Why do I get this error ?
Then I added require 'RedCloth'
to config/environment.rb
, and tried to run rails s
, but unfortunately I got:
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: ...
What am I doing wrong ?
I use Rails 3.0.1, Ruby 1.9.2.
bundle show RedCloth
=> D:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.8
Here is my workaround to your second error, "Couldn't load 1.9/redcloth_scan", which looks like a bug of RedCloth on Windows. After gem install RedCloth --no-rdoc
, I run
cd c:\Ruby192\lib\ruby\gems\1.9.1\gems\RedCloth-4.2.8\lib
mkdir 1.9
copy redcloth_scan.so 1.9
You should replace that directory with your path, "D:\Programs\Ruby\lib\ruby\gems\1.9.1\gems\RedCloth-4.2.8\lib", of course.
这篇关于如何在Windows上安装RedCloth?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!