Forum: Ruby on Rails rss maker make issue - Please help

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Mike B. (Guest)
on 2009-03-16 15:57
I am a RoR newbie.
I have a problem with getting the rss content when using rss:maker.make
(using rails 2.2.2 and Ruby 1.8). I am trying to get the full XML
definition to be written to a file. When I try it locally it works fine
and I get the data in the content object. However, when I try this on a
hosted environment content does not contain any data. Also when I output
the object using object.inspect, the content object look different.

Code:
     content = RSS::Maker.make('2.0') do |m|
        m.channel.title = @mychannel.title
        m.channel.link = @mychannel.link
        m.channel.description = @mychannel.description
        m.items.do_sort = true # sort items by date
           for myfeed in @myfeeds
               puts "new items found"
                i = m.items.new_item
                    i.title = myfeed.title
                    i.description = myfeed.description
                    i.link = ""
                    i.date = Time.parse(myfeed.created_at.to_s)
            end
        end
          puts content.inspect
           File.open(destination,"w") do |f|
              f.write(content.to_xml)
            end
object inspection
Locally,
#<RSS::Rss:0xcf730a8 @converter=nil, @rss_version="2.0",
@do_validate=true, @version="1.0", @encoding="UTF-8",
@xml_stylesheets=[], @channel=#<RSS::Rss::Channel:0xcf7306c @title.
.....

Hosted,
#<RSS::Rss:0x2b427c218948 @output_encoding=nil, @standalone=nil,
@version="1.0", @feed_version="2.0", @do_validate=true, @converter=nil,
@parent=nil, @feed_subtype=nil, @feed_type="rss", @xml_stylesheets=[],
@channel=#<RSS::Rss::Channel:0x2b427c2186a0 @dc_language=[], @ttl=nil,
@docs=nil, @dc_rights=[], @dc_description=[], @dc_coverage=[],
@category=[], @itunes_block=nil, @itunes_owner=nil, @generator=nil,
@image=nil,....
This topic is locked and can not be replied to.