要求';rubygems';和要求';红布';它不起作用。我怎样才能修好它?

要求';rubygems';和要求';红布';它不起作用。我怎样才能修好它?,ruby,redcloth,Ruby,Redcloth,我正在学习Ruby,从Peter Cooper的“开始Ruby从新手到专业人士”。我在读第七章。我已经安装了ruby 2.0。我面临着这个错误: C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- 2.0/redcloth_scan (LoadError) 尝试运行此代码时: require 'rubygems' require 'RedC

我正在学习Ruby,从Peter Cooper的“开始Ruby从新手到专业人士”。我在读第七章。我已经安装了ruby 2.0。我面临着这个错误:

C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- 2.0/redcloth_scan (LoadError)
尝试运行此代码时:

require 'rubygems'
require 'RedCloth'
r = RedCloth.new("This is a *test* of _using RedCloth_")
puts r.to_html
我得到了这个结果:

ruby redcloth.rb
C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- 2.0/redcloth_scan (LoadError)
Couldn't load 2.0/redcloth_scan
The $LOAD_PATH was:
C:/Ruby200/lib/ruby/gems/2.0.0/gems/RedCloth-4.2.9-x86-mingw32/lib
C:/Ruby200/lib/ruby/gems/2.0.0/gems/RedCloth-4.2.9-x86-mingw32/lib/case_sensitive_require
C:/Ruby200/lib/ruby/gems/2.0.0/gems/RedCloth-4.2.9-x86-mingw32/ext
C:/Ruby200/lib/ruby/site_ruby/2.0.0
C:/Ruby200/lib/ruby/site_ruby/2.0.0/i386-msvcrt
C:/Ruby200/lib/ruby/site_ruby
C:/Ruby200/lib/ruby/vendor_ruby/2.0.0
C:/Ruby200/lib/ruby/vendor_ruby/2.0.0/i386-msvcrt
C:/Ruby200/lib/ruby/vendor_ruby
C:/Ruby200/lib/ruby/2.0.0
C:/Ruby200/lib/ruby/2.0.0/i386-mingw32
    from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require'
    from C:/Ruby200/lib/ruby/gems/2.0.0/gems/RedCloth-4.2.9-x86-mingw32/lib/RedCloth.rb:13:in `<top (required)>'
    from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `require'
    from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:135:in `rescue in require'
    from C:/Ruby200/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:144:in `require'
    from redcloth.rb:2:in `<main>'
Exit code: 1
ruby redcloth.rb
C:/Ruby200/lib/ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:55:在'require'中:无法加载这样的文件--2.0/redcloth\u scan(加载错误)
无法加载2.0/redcloth\u扫描
$LOAD_路径为:
C:/Ruby200/lib/ruby/gems/2.0.0/gems/RedCloth-4.2.9-x86-mingw32/lib
C:/Ruby200/lib/ruby/gems/2.0.0/gems/RedCloth-4.2.9-x86-mingw32/lib/case\u sensitive\u require
C:/Ruby200/lib/ruby/gems/2.0.0/gems/RedCloth-4.2.9-x86-mingw32/ext
C:/Ruby200/lib/ruby/site\u ruby/2.0.0
C:/Ruby200/lib/ruby/site\u ruby/2.0.0/i386-msvcrt
C:/Ruby200/lib/ruby/site\u ruby
C:/Ruby200/lib/ruby/vendor\u ruby/2.0.0
C:/Ruby200/lib/ruby/vendor\u ruby/2.0.0/i386-msvcrt
C:/Ruby200/lib/ruby/vendor\u ruby
C:/Ruby200/lib/ruby/2.0.0
C:/Ruby200/lib/ruby/2.0.0/i386-mingw32
来自C:/Ruby200/lib/ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:55:in'require'
来自C:/Ruby200/lib/ruby/gems/2.0.0/gems/RedCloth-4.2.9-x86-mingw32/lib/RedCloth.rb:13:in`'
来自C:/Ruby200/lib/ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:135:in'require'
来自C:/Ruby200/lib/ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:135:in'rescue in require'
来自C:/Ruby200/lib/ruby/2.0.0/rubygems/core\u ext/kernel\u require.rb:144:in'require'
来自redcloth.rb:2:in`'
退出代码:1
我已经安装了ruby gems和RedCloth。他们没有给我一个错误。如果有人能对这个话题有所了解,我们将不胜感激。

试试这个: 转到C:/Ruby200/lib/ruby/gems/2.0.0/gems/RedCloth-4.2.9-x86-mingw32/lib 并创建一个名为“2.0”的目录。
然后将redcloth_scan.so从'C:/Ruby200/lib/ruby/gems/2.0.0/gems/redcloth-4.2.9-x86-mingw32/lib'复制到'2.0'目录。

我在以前安装了ruby 1.9.1的redcloth。
实际上,我怀疑RedCloth不能与Ruby 2.0一起使用。

在Ruby 2.x.x上,您需要编译gem。 例如,对于windows ruby 2.2.4:

设置DevKit()

运行到命令窗口:

gem安装RedCloth——平台=ruby

转到已安装的红布路径 lib\ruby\gems\2.2.0\gems\RedCloth-4.2.9\lib 在那里创建一个名为“2.2”的新目录,并将文件redcloth_scan.so复制到它上面

如果您使用gem-RedCloth-4.2.9-x86-mingw32,那么RedCloth\u scan.so包含ruby 1.9依赖项,它不适用于ruby 2.2.4。

请参阅以下文章: