我有一个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)还有没有人看过这个问题?我对这个错误一无所知。
发布于 2011-09-12 18:45:23
我遇到了同样的问题,似乎与Ruby 1.9.2的YAML解析有关
我黑进了公制fu,并插入了一个显式的心理YAML引擎需求:
metric_fu-2.1.1/lib/metric_fu.rb:
require 'rake'
require 'psych' # <-- added here
require 'yaml'现在可以工作了..。
发布于 2012-02-04 15:15:13
最简单的解决方案是在运行metrical时设置RUBYOPT环境变量,因此您可以输入:
RUBYOPT='-rpsych' metrical我正在这么做,而且一切都运行得很好。这篇博文为我解决了这个问题:http://excid3.com/blog/undefined-method-write-for-syckemitter/ (可能比黑进metric_fu要简单一点,直到他们解决了这个问题)。
https://stackoverflow.com/questions/7015414
复制相似问题