2009-07-15 12 views
0

JRuby on RailsとFeedToolsを使用している人はいますか?私はFeedToolsを実行しようとすると、私は次のエラーを取得しています:JRuby、Rails、およびFeedTool

NameError (undefined local variable or method `parser' for YAML:Module):. 

私はダウンmonkey_patch.rbにコードを追跡してきました。それはパーサーラインに爆破されていますが、私はRubyとRailsが初めてで、自分でそれをデバッグできませんでした。変わったのは、普通の古いRailsとRubyでうまくいきます。 JRubyが必要なのは、私がJavaコンテナにデプロイしようとしているからです。

require 'rexml/document' 
require 'yaml' 

module YAML 
def YAML.dump(obj, io = nil) 
    if obj.kind_of?(FeedTools::Feed) || obj.kind_of?(FeedTools::FeedItem) 
    # Dangit, you WILL NOT serialize these things. 
    obj.instance_variable_set("@xml_document", nil) 
    obj.instance_variable_set("@root_node", nil) 
    obj.instance_variable_set("@channel_node", nil) 
    end 
obj.to_yaml(io || io2 = StringIO.new) 
io || (io2.rewind; io2.read) 
end 

def YAML.load(io) 
     yp = parser.load(io) # <- Error here 
    if yp.kind_of?(FeedTools::Feed) || yp.kind_of?(FeedTools::FeedItem) 
    # No really, I'm serious, you WILL NOT deserialize these things. 
    yp.instance_variable_set("@xml_document", nil) 
    yp.instance_variable_set("@root_node", nil) 
    yp.instance_variable_set("@channel_node", nil) 
    end 
    yp 
end 
end 

答えて

1

これはJRuby 1.4で出荷する新しいYAML実装で修正されている可能性が非常に高いです。 JRubyの夜間ビルドを試しても問題が残っている場合はお知らせください。

関連する問題