How to tell bundler to use installed mswin32 version of a gem?
I did the:
gem install hpricot --platform=mswin32
It's correctly listed when I do gem list
:
*** LOCAL GEMS ***
abstract (1.0.0)
actionmailer (3.0.0)
actionpack (3.0.0)
activemodel (3.0.0)
activerecord (3.0.0)
activeresource (3.0.0)
activesupport (3.0.0)
arel (1.0.1)
builder (2.1.2)
bundler (1.0.0)
columnize (0.3.1)
erubis (2.6.6)
hpricot (0.8.2 x86-mswin32)
i18n (0.4.1)
mail (2.2.6.1)
mime-types (1.16)
minitest (1.6.0)
polyglot (0.3.1)
rack (1.2.1)
rack-mount (0.6.13)
rack-test (0.5.6)
rails (3.0.0)
railties (3.0.0)
rake (0.8.7)
rd_searchlogic (3.0.0.rc3)
rdoc (2.5.8)
sqlite3-ruby (1.3.1 x86-mingw32)
thor (0.14.2)
treetop (1.4.8)
tzi开发者_如何学运维nfo (0.3.23)
But bundle install
still tries to install and compile a version with native extentions:
Installing hpricot (0.8.2) with native extensions C:/Documents and Settings/matt/.pik/rubies/Ruby-192dev-preview3-1/lib/ruby/site_ruby/1.9.1/rubygems/insta
ller.rb:483:in `rescue in block in build_extensions': ERROR: Failed to build gem
native extension. (Gem::Installer::ExtensionBuildError)
How to tell it to use the mswin32 one?
You just need add option :platforms => :mswin
gem 'hpricot', :platforms => :mswin
精彩评论