You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Windows Server 2016下安装fcgi gem失败求助

安装FCGI Gem时遇到编译错误

环境

  • Windows Server 2016
  • Apache 2.4
  • Ruby 3.0.6(含webkit)
  • Rails 7.0.4.3

问题

执行命令 gem install fcgi 时出现编译错误,核心提示找不到fcgiapp.h文件,完整错误日志如下:

C:\Apache24\htdocs\redmine-5.0.5>gem install fcgi
Building native extensions. This could take a while...
ERROR:  Error installing fcgi:
        ERROR: Failed to build gem native extension.

    current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fcgi-0.9.2.2/ext/fcgi
C:/Ruby30-x64/bin/ruby.exe extconf.rb
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.h... no

current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fcgi-0.9.2.2/ext/fcgi
make DESTDIR\= sitearchdir\=./.gem.20230518-6868-obubmv sitelibdir\=./.gem.20230518-6868-obubmv clean
make: *** No hay ninguna regla para construir el objetivo 'clean'.  Alto.

current directory: C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fcgi-0.9.2.2/ext/fcgi
make DESTDIR\= sitearchdir\=./.gem.20230518-6868-obubmv sitelibdir\=./.gem.20230518-6868-obubmv
make: *** No hay objetivos.  Alto.

make failed, exit code 2

Gem files will remain installed in C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fcgi-0.9.2.2 for inspection.
Results logged to C:/Ruby30-x64/lib/ruby/gems/3.0.0/extensions/x64-mingw32/3.0.0/fcgi-0.9.2.2/gem_make.out

已尝试操作

  • 安装不同版本的fcgi gem,错误情况一致
  • 将fcgiapp.h单独放入C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/fcgi-0.9.2.2/ext/fcgi路径,无效果

解决方法

  1. 安装完整FastCGI开发库
    仅复制单个头文件无法满足编译需求,需下载对应Windows x64版本的FastCGI SDK,解压后将包含fcgiapp.h的include目录添加到系统环境变量INCLUDE,同时把库文件所在的lib目录添加到LIB环境变量。

  2. 手动指定路径安装
    若已安装FastCGI库,执行安装命令时直接指定头文件和库文件路径:

    gem install fcgi -- --with-fcgi-include=你的FastCGI/include路径 --with-fcgi-lib=你的FastCGI/lib路径
    
  3. 检查编译工具链
    确认Ruby配套的MinGW编译工具完整(比如RubyInstaller安装时勾选了开发工具组件),make命令报错也可能是缺少必要的编译依赖。

  4. 尝试替代部署方案
    若fcgi gem在Windows下编译始终受阻,可考虑用Passenger或Puma替代FastCGI运行Redmine,这两种部署方式在Windows环境下兼容性更稳定。

内容的提问来源于stack exchange,提问作者Tomas

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.21 18:53:12