2011-01-29 63 views
1

加载hpricot宝石时出现问题。 我在耙子任务中使用它,并在其中放入一个require "hpricot"。 但它不会加载错误消息:no such file to load -- hpricot 但是我会在我的宝石列表中看到它,但不知道为什么rake任务无法识别它。 有没有人有与hpricot宝石这种问题的经验?加载hpricot宝石时出现问题

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 

回答

1

我解决了这个问题。 我忘了将hpricot gem添加到我的rails应用程序的gem文件中。 在我将gem添加到gemfile并运行bundle install后,一切正常。

0

请尽量要求角度来说,Hpricot之前添加require 'rubygems'

+0

我做到了,但结果仍然相同。 – LeonS 2011-01-29 22:14:15