Quantcast
Channel: Feedzirra in Rails 3 - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Feedzirra in Rails 3

$
0
0

I am trying to get feedzirra running on rails 3, I tried by some methods I have found on the internet.

This is in my gemfile:

source 'http://gems.github.com'gem 'loofah', '1.0.0.beta.1'group :after_initialize do    gem 'pauldix-feedzirra'end

And i've out this after bundle.setup in root.rb

Bundler.require :after_initialize

And this is the code in my model (movie.rb)

class Movie < ActiveRecord::Base  def self.import_from_feed    feed = Feedzirra::Feed.fetch_and_parse("url-to.xml")    add_entries(feed.entries)  end  private  def self.add_entries(entries)    entries.each do |entry|      unless exists? :guid => entry.id        create!(          :title        => entry.title,          :synopsis     => entry.synopsis,          :cover        => entry.cover,          :duration     => entry.duration,          :channel      => entry.channel,          :imdb_rating  => entry.imdb_rating,          :imdb_votes   => entry.imdb_votes,          :imdb_id      => entry.imdb_votes        )      end    end  endend

I try to run the import_from_feed function from the console and I keep getting this error:

>> Movie.import_from_feedNameError: uninitialized constant Movie::Feedzirra    from /Users/myname/Ruby/appname/app/models/movie.rb:3:in `import_from_feed'    from (irb):1

Can someone help me out? Been trying for ages now!


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images