Welcome Guest | Login

Using a gem

Hello,
I'm trying to use the SimpleRSS gem.  So far, I've followed the instructions for freezing my gems.  I have gems in ~/.gems and have unpacked them to ~/testhelper/vendor

I am trying to call this code from application helper:

# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper

def woof
#"woofy the dog"
   require 'rubygems'
#require 'simple-rss'
#   gem 'simple-rss'
#    require 'open-uri'

   rss = SimpleRSS.parse open( http://slashdot.org/index.rdf')

   rss.channel.title # => "Slashdot"
   rss.channel.link # => "http://slashdot.org/"
   rss.items.first.link # => "http://books.slashdot.org/article.pl?sid=05/08/29/1319236&fro\
m=rss"


end
end


When I do that, I get this error:
uninitialized constant ApplicationHelper::SimpleRSS

Now, I'm getting a "We're sorry, but something went wrong" message.

Any thoughts?  On my local system and on my old server, I had the gems installed globally, not in the rails application, so I'm having problems with this migration.

TIA,
Sean

2007-02-13 01:19 PM

Hi,

Try putting those require statements in your environment.rb instead. Also, try removing the '#", which comments the line out.

If that doesn't work, try removing those require statements altogether, if you have frozen and unpacked your gems.

Hope this helps.

-Chad

http://sceneseed.com

2007-02-13 05:19 PM

Hi there - also - if it helps at all.  I've gone ahead and installed the gem on your server.

Successfully installed simple-rss-1.1

so you shouldn't have to mess around with downloading it yourself if you don't want - try your app without any hint of it in your vendor folder or environment files.  Then if it works you can freeze it.  

Cheers,

~William

2007-02-13 05:30 PM


Hello Guest! In order to post you must be an active client with us, please log in or sign up.