(轉)ERROR:Failedtobuildgemnativeextension
這幾天本人在Window server 2003(工作機)中搭建Cucumber環境時(可以看我的另一篇文章:http://www.cnblogs.com/puresoul/archive/2011/11/18/2254407.html),當執行gem install cucumber時,報錯:ERROR: Failed to build gem native extension.到處搜尋未果,最後在這裡找到了答案:https://github.com/oneclick/rubyinstaller/wiki/Troubleshooting,特此轉來。本人就不做翻譯了,有需要的朋友儘管拿去,原文如下:
You’ve installed both RubyInstaller and DevKit following the instructions but during gem installation, you receive a message like this:
C:devkit>gem install rdiscount --platform=ruby Temporarily enhancing PATH to include DevKit... Building native extensions. This could take a while... ERROR: Error installing rdiscount: ERROR: Failed to build gem native extension. C:/ruby/bin/ruby.exe extconf.rb C:/ruby/bin/ruby.exe: No such file or directory -- extconf.rb (LoadError)
Or sometimes just this:
ERROR: Error installing rdiscount:
ERROR: Failed to build gem native extension.
C:/Ruby187/bin/ruby.exe extconf.rb
This has been reported to our group here and here.
After a long back and forth investigation, we found two possible causes for this issue: COMSPEC
environment variable (scenario A) and AutoRun registry setting (scenario B), both described below:
Scenario A
Using a command prompt, invoke the following command:
SET COMSPEC
If in the output you see something different than cmd.exe
as value for that variable, then please adjust it to use cmd.exe
Some tools might change your command processor command, which interferes with Ruby invoking child processes.
Change that and try to install the gem again.
Scenario B
If the problem persist, invoke the following commands in the same command prompt:
REG QUERY "HKCUSoftwareMicrosoftCommand Processor" REG QUERY "HKLMSoftwareMicrosoftCommand Processor"
Execute each line individually. Once you run it, will see something like this:
HKEY_CURRENT_USERSoftwareMicrosoftCommand Processor CompletionChar REG_DWORD 0x9 DefaultColor REG_DWORD 0x0 EnableExtensions REG_DWORD 0x1 PathCompletionChar REG_DWORD 0x9
The columns of information are Key, Type and Value. If you see a key named AutoRun
, there is a chance this is the culprit of the error you’re receiving.
AutoRun
interferes with Ruby messing with child process executing and by result, affecting gem installation. Please remove it with the following command:
REG DELETE "HKCUSoftwareMicrosoftCommand Processor" /v AutoRun
Once you’re done, try opening a new command prompt and executing gem installation again.
相關文章
- LOGIN:ERROR-Failed to initialize policy manager(轉)ErrorAI
- Error 1: Filename must be either an absolute pathname or blocklist(轉)ErrorBloC
- android studio Error:Unable to start the daemon process【轉】AndroidError
- 轉載:ORA-00600: internal error code, arguments: [504]Error
- ORA-12541: TNS:no listener (DBD ERROR: OCIServerAttach) (轉)ErrorServer
- Inserting Data with DML Error Logging(轉)Error
- configure error:系統時間問題!(轉)Error
- mount error(5): Input/output errorError
- 【ERROR】OPatch failed with error code 73ErrorAI
- error:slave communication error with ASMErrorASM
- ERROR: slave communication error with ASMErrorASM
- MMON encountered error 959, clearing the errorError
- 如何解決"Parse error: syntax error"Error
- php的錯誤日誌級別 error_report(轉)PHPError
- 【轉】Cannot load ICU resource bundle 'ggMessage', error code 2Error
- 【轉】fatal error C1189: #error : missing -D__STDC_CONSTANT_MACROS / #define __STDC_CONSTANT_MACROSErrorMacROS
- DB error due to HP-UX Error:23ErrorUX
- CRS ERROR - PRKC-1073 - ErrorError
- Error page: / Error infos: DedeCms錯誤警告Error
- Error for iOSErroriOS
- error事件Error事件
- Error: no such columnError
- DepthClipEnable errorError
- Error StackError
- innobackupex: Error: noError
- ERROR 1045 (28000): ProxySQL Error: 報錯ErrorSQL
- Original error: Error: socket hang upError
- ERROR 2026 (HY000): SSL connection error: unknown error numberError
- ORACLE SQLPLUS 報 error while loading shared libraries[轉]OracleSQLErrorWhile
- 利用On Error Resume Next來驗證日期的輸入(ASP 3.0) (轉)Error
- Golang 學習——error 和建立 error 原始碼解析GolangError原始碼
- Setup had an error Error: At least one of these paths should existErrorAST
- MySQL ERROR Got an error reading communication packetsMySqlErrorGo
- [ERROR] InnoDB: Unable to lock ./ibdata1, error: 11Error
- Install Error : ERROR:SQLException null Resultset [ID 875002.1]ErrorSQLExceptionNull
- FATAL ERROR IN TWO-TASK SERVER: error = 12569ErrorServer
- Last_IO_Error: Got fatal error 1236ASTErrorGo
- ORACLE STREAM ERROROracleError