2011-08-10 46 views
1

我有一個Ruby 1.9.2和Rails 3.0.9開發環境。當我在應用程序上運行gem「metrical」時,出現以下錯誤:運行度量時出錯

** Running the specs/tests in the [test] environment 
Analyzing:  100% |oooooooooooooooooooooooooooooooooooooooooo| Time: 00:00:00 
/Users/tester/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/psych/visitors/emitter.rb:17:in `end_document': undefined method `write' for #<Syck::Emitter:0x000001028d2388> (NoMethodError) 

任何人都看到此問題?我對這個錯誤沒有想法。

+0

有沒有想過這個?我有同樣的問題... –

+0

丹尼爾 - 我有同樣的問題。找到解決方案。在下面發佈。 –

回答

1

我遇到了同樣的問題,似乎與YAML使用Ruby 1.9.2

解析我攻入指標FU和插入的精極度緊張YAML引擎的一個明確要求:

metric_fu-2.1 ·1/lib中/ metric_fu.rb:

require 'rake' 
require 'psych' # <-- added here 
require 'yaml' 

而現在的作品...

0

最簡單的辦法是,當你運行阿房宮設置RUBYOPT環境變量,所以而不是度量你輸入:

RUBYOPT='-rpsych' metrical 

我這樣做,它都工作正常。這篇博文發現了我:http://excid3.com/blog/undefined-method-write-for-syckemitter/(可能比入侵metric_fu更簡單,直到他們解決這個問題)。