首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Windows :安装jekyll + gem更新失败的错误-错误:生成gem本机扩展失败

Windows :安装jekyll + gem更新失败的错误-错误:生成gem本机扩展失败
EN

Stack Overflow用户
提问于 2022-03-22 12:54:31
回答 2查看 196关注 0票数 0

系统: Windows 10 (pro,最新)

大家好,我是新来的,我知道我有个问题问了很多次,但是…坦白地说,我不明白答案,而且我完全失去了…英语不是我的母语,如果它显示出来了,很抱歉。

我想做的事:

我想为个人博客安装Jekyll。安装结束时,我遇到了一个问题:Error installing jekyll: ERROR: Failed to build gem native extension

我已经做了什么:

  • 按照这里的说明,我已经安装了Ruby+Devkit 3.1.1-1 (x64),在安装结束时跨越了ridk install
  • ridk安装打开一个命令窗口,我已经安装了所要求的3件事情,它似乎已经成功了。
  • 我在gcc中安装了mingw-get-setup.exe作为受抚养人(如果我没有弄错的话,也许没有必要)。
  • 在git gem install bundler中运行(不管是否有管理权限,似乎也是如此)。成功。
  • 在git中运行gem install jekyll - fail。(即使在重新启动计算机之后)。
  • 我在另一个线程中看到了一个答案,他告诉我在安装Jekyll之前先做一个gem update -失败。

因此,我想问题更多的是在这一端,下面是日志:

第一部分:

代码语言:javascript
运行
复制
ERROR:  Error installing bigdecimal:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bigdecimal-3.1.2/ext/bigdecimal
C:/Ruby31-x64/bin/ruby.exe -I C:/Ruby31-x64/lib/ruby/site_ruby/3.1.0 -r ./siteconf20220322-6432-916opp.rb extconf.rb
checking RUBY_BIGDECIMAL_VERSION... 3.1.2
checking for __builtin_clz()... *** 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.

mkmf.log文件:

代码语言:javascript
运行
复制
PATH=".;C:/Ruby31-x64/lib;C:\Ruby31-x64\bin;C:\Ruby31-x64\msys64\mingw64\bin;C:\Ruby31-x64\msys64\usr\bin;C:\Users\User\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\local\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\usr\bin;C:\Program Files\Git\mingw64\bin;C:\Program Files\Git\usr\bin;C:\Users\User\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Windows\System32\OpenSSH;C:\Program Files\dotnet;C:\Program Files\nodejs;C:\ProgramData\chocolatey\bin;C:\Program Files\Git\cmd;C:\Ruby31-x64\bin;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\Users\User\AppData\Local\atom\bin;C:\Users\User\AppData\Local\GitHubDesktop\bin;C:\Users\User\AppData\Roaming\npm;C:\MinGW\bin;C:\Program Files\Git\usr\bin\vendor_perl;C:\Program Files\Git\usr\bin\core_perl" "gcc -o conftest.exe -IC:/Ruby31-x64/include/ruby-3.1.0/x64-mingw-ucrt -IC:/Ruby31-x64/include/ruby-3.1.0/ruby/backward -IC:/Ruby31-x64/include/ruby-3.1.0 -I. -D__USE_MINGW_ANSI_STDIO=1 -DFD_SETSIZE=2048 -D_WIN32_WINNT=0x0600 -D__MINGW_USE_VC2005_COMPAT -D_FILE_OFFSET_BITS=64  -O3 -fno-fast-math -fstack-protector-strong conftest.c  -L. -LC:/Ruby31-x64/lib -L. -pipe -s -fstack-protector-strong -Wl,--no-as-needed  -m64   -lx64-ucrt-ruby310  -lshell32 -lws2_32 -liphlpapi -limagehlp -lshlwapi -lbcrypt  "
conftest.c:1:0: sorry, unimplemented: 64-bit mode not compiled in
 #include "ruby.h"
 
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <winsock2.h>
4: #include <windows.h>
5: int main(int argc, char **argv)
6: {
7:   return !!argv[argc];
8: }
/* end */

第二部分

代码语言:javascript
运行
复制
C:/Ruby31-x64/lib/ruby/3.1.0/mkmf.rb:498:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
To see why this extension failed to compile, please check the mkmf.log which can be found here: //(same mkmf.log)

extconf failed, exit code 1

因此,我在第二部分介绍了需要安装…的开发工具。有这条线试图回答这个问题,但是Ruby+Devkit不是在处理这个问题吗?我错过了什么吗?

我已经看到其他的答案告诉我要在路径中添加devkit,但是我的计算机…中没有任何的…文件夹。我迷路了。

谢谢你的回答,希望我没有忘记任何事情

EN

回答 2

Stack Overflow用户

发布于 2022-03-23 10:08:20

好的,我想我找到了答案:问题是我在使用git的命令提示符。我尝试了commande prompt with ruby,安装似乎运行良好。

所以,我不明白git bash的问题在哪里,但是我现在已经完成了,因为它看起来很好。

谢谢你的帮助!

票数 1
EN

Stack Overflow用户

发布于 2022-03-22 23:18:58

我没有成功地复制你的问题,一切都适合我。您能否打开命令提示符并通过以下命令的输出:

代码语言:javascript
运行
复制
ridk install
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71572416

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档