在Windows XP上运行
gem install RedCloth
时,我遇到了以下问题: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
为什么会出现这个错误?
然后我在config/environment.rb
中添加了require 'RedCloth'
,并尝试运行rails s
,但不幸的是我得到了以下错误:
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。
bundle show RedCloth
=> D:/Programs/Ruby/lib/ruby/gems/1.9.1/gems/RedCloth-4.2.8
gem install --no-rdoc RedCloth
。 - drummondj