1

在混合平台开发组中升级到 rails 3,并使用 Bundler for gems。我在 Windows 上。当我运行 Bundle Install 时,它成功完成,但不会安装 hpricot。hpricot线是:

gem "hpricot", "0.8.3", :platform => :mswin

也试过

gem "hpricot", :platform => :mswin

两者都很好,但是当我尝试做一个“捆绑秀 hpricot”时,我得到:

Could not find gem 'hpricot' in the current bundle.

如果我运行一个rails控制台并尝试“需要'hpricot'”,我会得到:

LoadError: no such file to load -- hpricot

我也手动安装了 hpricot,但仍然出现上述错误。这在移动到 rails 3 之前运行良好。

4

2 回答 2

2

在控制台中尝试此操作,然后进行捆绑安装,它将起作用:

gem install hpricot --platform=mswin32
于 2012-09-01T10:26:10.590 回答
1

可能您使用的是使用 MinGW 构建的 ruby​​ 版本,在这种情况下,您的平台将是“mingw”而不是“mswin”。尝试将您的 Gemfile 行更改为以下内容:

gem "hpricot", "0.8.3", :platform => :mingw

如果您有其他开发人员正在使用当前设置并且不想为他们破坏它,请将其更改为:

gem "hpricot", "0.8.3", :platforms => [:mswin, :mingw]
于 2010-11-23T22:11:45.827 回答