Search code examples
ruby-on-railsrubyrubygemshpricot

Problem with loading the hpricot gem


I have a problem with loading the hpricot gem. I'm using it in a rake task and put a require "hpricot" in it. But it doesn't load with a error message:no such file to load -- hpricot But I'll see it in my gem list but don't know why the rake task doesn't recognize it. Does anybody has experience with that kind of problem with the hpricot gem?

output of gem list -d hpricot:

*** LOCAL GEMS ***

hpricot (0.8.3)
   Author: why the lucky stiff
   Rubyforge: http://rubyforge.org/projects/hobix
   Homepage: http://code.whytheluckystiff.net/hpricot/
   Installed at: /Library/Ruby/Gems/1.8

   a swift, liberal HTML parser with a fantastic lib

Solution

  • I solved the problem. I forgot to add the hpricot gem to the gem file of my rails app. After I added the gem to the gemfile and ran a bundle install , everything works fine.