/ / JRuby、Rails、FeedTool - ruby​​-on-rails、jruby、feedtools

JRuby、Rails、FeedTool - ruby​​-on-rails、jruby、feedtools

JRuby on RailsをFeedToolsで使用している人は誰ですか? FeedToolsを実行しようとすると、次のエラーが表示されます。

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は1

これは、JRuby 1.4で出荷される新しいYAML実装で修正される可能性が非常に高いです。あなたはJRubyの夜間ビルドを試してみることができますか?