开发者

Rails Bundler on windows refuses to install hpricot (even on manual gem install get Error: no such file to load -- hpricot)

Upgraded to rails 3, and using Bundler for gems, in a mixed platform development group. I am on Windows. When I ru开发者_高级运维n 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


It may be that you are using a version of ruby that was built with MinGW in which case your platform will be 'mingw' rather than 'mswin'. Try changing your Gemfile line to the following:

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

And if you have other developers that are using the current setup and don't wan to break it for them, change it to this:

gem "hpricot", "0.8.3", :platforms => [:mswin, :mingw]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜