不能使用hirb rails gem

时间:2012-04-06 22:17:24

标签: gem

[变更]

  • 问题不在于'enale'的错字而不是'enable'
  • --no-ri --no-rdoc标志
  • 的安装没有问题
  • 现在执行require enable会出错,而不是false(不明白为什么)

我在使用Gem hirb格式化rails console的输出时遇到了一些麻烦。

$ gem install hirb --no-ri --no-rdoc
Successfully installed hirb-0.6.2
1 gem installed

$ rails c
Loading development environment (Rails 3.2.3)
irb(main):001:0> require 'hirb'
LoadError: cannot load such file -- hirb
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_
support/dependencies.rb:251:in `require'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_
support/dependencies.rb:251:in `block in require'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_
support/dependencies.rb:236:in `load_dependency'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/activesupport-3.2.3/lib/active_
support/dependencies.rb:251:in `require'
        from (irb):1
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/comman
ds/console.rb:47:in `start'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/comman
ds/console.rb:8:in `start'
        from c:/Ruby193/lib/ruby/gems/1.9.1/gems/railties-3.2.3/lib/rails/comman
ds.rb:41:in `<top (required)>'
        from script/rails:6:in `require'
        from script/rails:6:in `<main>'
irb(main):002:0>

我正在运行Ruby 1.9.3,Rails 3.2.3,Bundler 1.1.3,Windows 7 64位。

1 个答案:

答案 0 :(得分:11)

您输错了,您应该输入Hirb.enable

gem hirb添加到rails项目的Gemfile中。