2012-04-06 58 views
5

[變化]不能使用hirb軌寶石

  • 問題不是的「及時在」錯字,而不是「啓用」
  • 安裝沒有問題去與--no-ri --no-rdoc標誌
  • 現在在做require enable給出了一個錯誤,而不是false(不知道爲什麼)

我在使用的寶石hirb格式化軌利弊的輸出一些麻煩OLE。

$ 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位。

+0

錯字:hirb.enaBle中帶字母'b' – YogiZoli 2012-04-13 05:59:27

+0

只需添加--no-ri --no-rdoc進行寶石安裝,並且不會產生文檔安裝問題 – YogiZoli 2012-04-13 06:00:11

回答

11

你已經有了一個錯字,應鍵入Hirb.enable

添加gem hirb到Gemfile中的軌道項目。

+0

我已更新該問題。問題不在於錯字。請看看上面的內容。謝謝。 – nunos 2012-04-14 01:20:44

+1

您是否將'gem hirb'添加到您的rails項目的Gemfile中? – megas 2012-04-14 09:26:43

+1

我忘了。這是多麼愚蠢的錯誤。它現在正在工作。謝謝。 – nunos 2012-04-14 12:22:23