本文介绍了Windows上的Rails Bundler拒绝安装hpricot(即使是手动安装gem也会得到错误:没有要加载的文件 - hpricot)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

  gemhpricot,0.8.3,:platform => :mswin 

也试过了

  gemhpricot,:platform => :mswin 

两者都很好,但是当我尝试做一个bundle show hpricot时,我得到:

 在当前包中找不到gem'hpricot'。 

如果我运行rails控制台并尝试require'hpricot',我会得到:

  LoadError:没有要加载的文件 -  hpricot 

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

解决方案

在控制台中尝试此操作,然后执行捆绑安装, p>

  gem install hpricot --platform = mswin32 


Upgraded to rails 3, and using Bundler for gems, in a mixed platform development group. I am on Windows. When I run Bundle Install it completes succesfully but will not install hpricot. The hpricot line is:

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

also tried

gem "hpricot", :platform => :mswin

Both complete fine but when I try to do a "bundle show hpricot" I get:

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

If I do a run a rails console and try "require 'hpricot'" I get:

LoadError: no such file to load -- hpricot

I have manually installed hpricot as well, and still get the above error. This worked fine before moving to rails 3.

解决方案

Try this in console and then do bundle install, it will work:

gem install hpricot --platform=mswin32

这篇关于Windows上的Rails Bundler拒绝安装hpricot(即使是手动安装gem也会得到错误:没有要加载的文件 - hpricot)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-01 22:54