[英]Bundler doesn't want to install hpricot on Windows XP with Ruby 1.8.7
I develop on a Windows machine but deploy to Debian. 我在Windows机器上进行开发,但部署到Debian。 Trying to use hpricot with Rails 3 app.
尝试在Rails 3应用程序中使用hpricot。 I can get the gem to install using :
我可以使用以下命令安装gem:
gem install hpricot --platform=mswin32
But when I do this in the bundle file - it keeps throwing an error (I think it's trying to install the wrong version of hpricot (not windows specific) 但是,当我在捆绑文件中执行此操作时,它会不断抛出错误(我认为它正在尝试安装错误版本的hpricot(不是特定于Windows)
group :production do
gem "hpricot", "0.8.3"
end
group :development, :test do
gem "hpricot", "0.8.3", :platforms => [:mswin, :mingw]
end
This is from another question here on stackoverflow - but it's not working for me. 这是关于stackoverflow的另一个问题-但这对我不起作用。
Any ideas? 有任何想法吗?
PS: PS:
Windows XP sp3 with Ruby 1.8.7 with Rails 3.0.3 with bundler 1.0.7 Windows XP sp3,带Ruby 1.8.7,带Rails 3.0.3,带捆绑程序1.0.7
EDIT 编辑
Forgot to paste my error: 忘记粘贴我的错误:
bundle install
Fetching source index for http://rubygems.org/
which: no sudo in (.;C:\Program Files\ImageMagick-6.6.5-Q16;C:\ruby\Ruby187\bin;C:\Program Files\ActiveState Komodo Edit 6\;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\Program Files\e\cmd;C:\Program Files\MySQL\MySQL Server 5.1\bin;C:\WINDOWS\system32\WindowsPowerShell\v1.0;c:\tools;C:\gnuwin32\bin;C:\tools\wkhtmltopdf;C:\Python31;C:\Program Files\TortoiseHg\;C:\Program Files\TortoiseGit\bin; c:\program files\videolan\vlc;C:\Program Files\SMPlayer\mplayer;C:\Program Files\Git\cmd;C:\Program Files\QuickTime\QTSystem\;C:\Program Files\Calibre2\;c:\ruby\jruby-1.5.5\bin;C:\Program Files\Common Files\Shoes\0.r1514\..)
Using rake (0.8.7)
Using abstract (1.0.0)
Using activesupport (3.0.3)
Using builder (2.1.2)
Using i18n (0.4.2)
Using activemodel (3.0.3)
Using erubis (2.6.6)
Using rack (1.2.1)
Using rack-mount (0.6.13)
Using rack-test (0.5.6)
Using tzinfo (0.3.23)
Using actionpack (3.0.3)
Using mime-types (1.16)
Using polyglot (0.3.1)
Using treetop (1.4.9)
Using mail (2.2.10)
Using actionmailer (3.0.3)
Using arel (2.0.4)
Using activerecord (3.0.3)
Using activeresource (3.0.3)
Using bcrypt-ruby (2.1.4)
Using bundler (1.0.7)
Using cancan (1.5.0)
Using haml (3.0.24)
Using compass (0.10.6)
Using warden (1.0.3)
Using devise (1.1.5)
Installing hpricot (0.8.3) Temporarily enhancing PATH to include DevKit...
with native extensions C:/ruby/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:483:in `build_extensions': ERROR: Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)
C:/ruby/Ruby187/bin/ruby.exe extconf.rb
checking for stdio.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=C:/ruby/Ruby187/bin/ruby
Gem files will remain installed in C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/hpricot-0.8.3 for inspection.
Results logged to C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/hpricot-0.8.3/ext/fast_xs/gem_make.out
from C:/ruby/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `each'
from C:/ruby/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:446:in `build_extensions'
from C:/ruby/Ruby187/lib/ruby/site_ruby/1.8/rubygems/installer.rb:198:in `install'
from C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/source.rb:95:in `install'
from C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:55:in `run'
from C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
from C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/spec_set.rb:12:in `each'
from C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:44:in `run'
from C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/installer.rb:8:in `install'
from C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/cli.rb:225:in `install'
from C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `send'
from C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/task.rb:22:in `run'
from C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/invocation.rb:118:in `invoke_task'
from C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor.rb:246:in `dispatch'
from C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/lib/bundler/vendor/thor/base.rb:389:in `start'
from C:/ruby/Ruby187/lib/ruby/gems/1.8/gems/bundler-1.0.7/bin/bundle:13
from C:/ruby/Ruby187/bin/bundle:19:in `load'
from C:/ruby/Ruby187/bin/bundle:19
We've had similar problems with bundler and Windows and one thing to check is that the specific version is available for both Windows and Linux/ruby native systems. 我们在捆绑程序和Windows上也遇到了类似的问题,需要检查的一件事是该特定版本可用于Windows和Linux / ruby本机系统。
It may also be a good idea to do a bundle install on your deployment machine first, and then bring the Gemfile.lock file over to your Windows development box. 首先在您的部署计算机上进行捆绑安装,然后将Gemfile.lock文件带到Windows开发箱中,这也是一个好主意。
I'm no bundler expert, and far from a "Ruby in Windows-land" expert, but just from doing a little bit of research the platforms
flag that you are trying to use in your Gemfile doesn't seem to be valid. 我不是捆绑程序专家,也不是“ Windows领域的Ruby”专家,但是仅作一点点研究,您尝试在Gemfile中使用的
platforms
标志似乎无效。 The only information I could find on the topic was the following issue on the bundler github page https://github.com/carlhuda/bundler/issues/issue/663 . 我可以在该主题上找到的唯一信息是捆绑程序github页面https://github.com/carlhuda/bundler/issues/issue/663上的以下问题。 Hope this helps.
希望这可以帮助。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.