繁体   English   中英

安装 fcgi 时出现 Rails 错误:无法构建 gem 原生扩展

[英]Rails error while installing fcgi: Failed to build gem native extension

我正在运行命令

bundle install

在我的 Rails 项目上,它给出了错误:

...
Using activerecord (3.0.11) 
Using activeresource (3.0.11) 
Using bigdecimal (1.1.0) 
Installing fcgi (0.8.8) with native extensions 
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /home/jjboat/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb 
checking for fcgiapp.h... no
checking for fastcgi/fcgiapp.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.

您需要安装 fcgi 开发包才能构建本机扩展(并且您还必须在此之前安装 C 构建链)。 您尚未在此处指定您的发行版,但在 Red Hat(以及 Fedora 等衍生产品)上,您通常会这样做:

sudo yum install fcgi-devel

在 Debian(和 Ubuntu)上,你可以这样做:

sudo apt-get install libfcgi-dev

我不是 100% 确定 Debian 中的软件包名称,但您应该很容易弄清楚。

如果您在 MacOS X 上使用 fcgi gem 遇到同样的错误(在 10.7.5 上测试)。 您可以使用 homebrew ( Link ) 获取所需的开发包:

brew install fcgi

然后你应该准备好安装gem了:

gem install fcgi -v '0.8.8'

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM