简体   繁体   English

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

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

I was running the command我正在运行命令

bundle install

on my Rails project, and it gave the error:在我的 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.

You need to install the fcgi development package to be able to build native extensions (and you have to have install a C build chain before that as well).您需要安装 fcgi 开发包才能构建本机扩展(并且您还必须在此之前安装 C 构建链)。 You haven't specified your distro here, but on Red Hat (and derivatives like Fedora) you'll generally do it like this:您尚未在此处指定您的发行版,但在 Red Hat(以及 Fedora 等衍生产品)上,您通常会这样做:

sudo yum install fcgi-devel

and on Debian (and Ubuntu) you can do the same like this:在 Debian(和 Ubuntu)上,你可以这样做:

sudo apt-get install libfcgi-dev

I'm not 100% certain about the name of the package in Debian, but it should be easy for you to figure it out.我不是 100% 确定 Debian 中的软件包名称,但您应该很容易弄清楚。

If you hit this same error with the fcgi gem on MacOS X (tested on 10.7.5).如果您在 MacOS X 上使用 fcgi gem 遇到同样的错误(在 10.7.5 上测试)。 You can get the development packages required using homebrew ( Link ):您可以使用 homebrew ( Link ) 获取所需的开发包:

brew install fcgi

Then you should be all set to install the gem:然后你应该准备好安装gem了:

gem install fcgi -v '0.8.8'

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

相关问题 "<i>&quot;ERROR: Failed to build gem native extension.&quot;<\/i> “错误:无法构建 gem 原生扩展。”<\/b> <i>while installing Rails<\/i>在安装 Rails 时<\/b>" - "ERROR: Failed to build gem native extension." while installing Rails 在Rails上安装ruby时出错,无法构建gem本机扩展 - Error while installing ruby on rails,Failed to build gem native extension 安装rails时出错错误:无法构建gem本机扩展 - Error installing rails ERROR: Failed to build gem native extension Rails:安装 rmagick 时出错 - 错误:无法构建 gem 本机扩展 - Rails: Error installing rmagick - ERROR: Failed to build gem native extension 安装 Ruby on Rails 时出错:“无法构建 gem 本机扩展” - Error when installing Ruby on Rails: “Failed to build gem native extension” 安装 Rails 6.0.0 时出错:无法构建 gem 原生扩展 - Error installing Rails 6.0.0: Failed to build gem native extension 安装 rails 时出错,无法构建 gem 本机扩展 - Error installing rails, failed to build gem native extension 在Ubuntu 16.04上安装Rails时出错,无法构建gem本机扩展 - error installing rails on ubuntu 16.04 failed to build gem native extension 错误:安装Rails时无法构建gem本机扩展 - ERROR: Failed to build gem native extension when installing rails 无法构建Gem扩展错误,安装滑轨 - Failed to Build Gem Extension Error Installing rails
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM