如何处理失败的本地扩展在Windows上创建gem? [英] What to do about failed native extension builds in gem on Windows?
问题描述
我下载的几个Rails应用程序依赖于 bson_ext
,这似乎是一个本地代码库。当我为应用程序运行 rake gems:install
时,出现以下错误消息:
错误:安装bson_ext时出错:
错误:无法构建gem本机扩展。
d:/Ruby187/bin/ruby.exe extconf.rb
检查asprintf()... no
检查ruby / st.h ... no
检查st.h ...没有
检查ruby / regex.h ...没有
检查regex.h ...没有
检查ruby / encoding.h ... no
创建Makefile
$ b $ make make
'make'不被识别为内部或外部命令,
可操作的程序或批处理文件。
Gem文件将继续安装在d:/Ruby187/lib/ruby/gems/1.8/gems/bson_ext-1.0.1中进行检查。
记录到d的结果:/Ruby187/lib/ruby/gems/1.8/gems/bson_ext-1.0.1/ext/cbson/gem_make.out
我的问题是:
-
我的rails应用程序会因此而失败,我想我知道如果我需要构建这个gem,我可以在Windows上完成它吗?
- >
如果可以在Windows上构建,我需要什么工具链? GCC?
-
我应该放弃Windows for Rails开发,并使用我的Mac或Linux VM吗?
尝试使用 RubyInstaller 和可选的 DevKit 。安装DevKit后,您应该能够在Windows上构建(编译)大多数本机扩展。
A couple of Rails applications I downloaded have dependencies on bson_ext
which appears to be a native code library. When I run rake gems:install
for the app I get the following error message:
ERROR: Error installing bson_ext: ERROR: Failed to build gem native extension. d:/Ruby187/bin/ruby.exe extconf.rb checking for asprintf()... no checking for ruby/st.h... no checking for st.h... no checking for ruby/regex.h... no checking for regex.h... no checking for ruby/encoding.h... no creating Makefile make 'make' is not recognized as an internal or external command, operable program or batch file. Gem files will remain installed in d:/Ruby187/lib/ruby/gems/1.8/gems/bson_ext-1.0.1 for inspection. Results logged to d:/Ruby187/lib/ruby/gems/1.8/gems/bson_ext-1.0.1/ext/cbson/gem_make.out
My questions are:
Will my rails application fail because of this, I think I know the answer to this?
If I need to build this gem can I do it on windows?
If it can be built on Windows what toolchain do I need? GCC?
Should I just abandon Windows for Rails development and use my Mac or a Linux VM instead?
Try using RubyInstaller and the optional DevKit. With the DevKit installed you should be able to build (compile) most native extensions on windows.
这篇关于如何处理失败的本地扩展在Windows上创建gem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!