我在加载hpricot gem时遇到了问题。我在一个rake任务中使用它,并在里面放了一个require "hpricot"。但是它没有加载错误消息:no such file to load -- hpricot,但是我会在gem列表中看到它,但是不知道为什么rake任务不能识别它。有谁有处理hpricot gem这类问题的经验吗?
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发布于 2011-02-05 21:46:26
我解决了这个问题。我忘记将hpricot gem添加到我的rails应用程序的gem文件中。在我将gem添加到gemfile并运行bundle install之后,一切工作正常。
发布于 2011-01-30 04:29:26
请先尝试添加require 'rubygems',然后再请求hpricot。
https://stackoverflow.com/questions/4839226
复制相似问题