简体   繁体   中英

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

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.

请先添加require 'rubygems'然后再要求使用hpricot。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM