2011-01-29 160 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