NameError - uninitialized constant FeedEntry::Feedzirra

296 views Asked by At

I have a FeedEntry.rb which has this line in it:

class FeedEntry < ActiveRecord::Base

def self.update_from_feed(feed_url)
feed = Feedzirra::Feed.fetch_and_parse(feed_url)
end

When I try calling FeedEntry.update_from_feed("http://feeds.feedburner.com/railscasts") I get the following error:

NameError - uninitialized constant FeedEntry::Feedzirra:
  activesupport (3.2.14.rc2) lib/active_support/dependencies.rb:520:in `load_missing_constant'
  activesupport (3.2.14.rc2) lib/active_support/dependencies.rb:192:in `block in const_missing'
  activesupport (3.2.14.rc2) lib/active_support/dependencies.rb:190:in `const_missing'
  app/models/feed_entry.rb:5:in `update_from_feed'

I have the gem 'pauldix-feedzirra' in my Gemfile and ran bundle install. I can't figure out why the issue is. Help?

2

There are 2 answers

0
user2345093 On BEST ANSWER

Using gem 'feedzirra' instead of gem 'pauldix-feedzirra' in my Gemfile fixed the issue.

2
amb110395 On

Try adding this to your model:

require 'feedzirra'