简体   繁体   English

错误:安装导轨时出错:错误:无法构建 gem 本机扩展

[英]ERROR: Error installing rails: ERROR: Failed to build gem native extension

I was getting some json errors on my rails app (it was on a pretty old version) at one point, some mysql errors at others, so I reinstalled everything to the latest versions with rvm.我的 rails 应用程序有一次出现了一些 json 错误(它是一个非常旧的版本),在其他时候出现了一些 mysql 错误,所以我用 rvm 将所有内容重新安装到最新版本。 A lot of the stuff I'm googling says an older version of xcode, but when I run xcodebuild -version I get:我在谷歌上搜索的很多东西都说是旧版本的 xcode,但是当我运行xcodebuild -version我得到:

Xcode 4.5.2
Build version 4G2008a

Here's the full error on gem install rails:这是 gem install rails 上的完整错误:

jakes-MacBook-Pro:~ mctesterson$ sudo gem install rails
Fetching: i18n-0.6.1.gem (100%)
Fetching: multi_json-1.4.0.gem (100%)
Fetching: activesupport-3.2.9.gem (100%)
Fetching: builder-3.0.4.gem (100%)
Fetching: activemodel-3.2.9.gem (100%)
Fetching: rack-1.4.1.gem (100%)
Fetching: rack-cache-1.2.gem (100%)
Fetching: rack-test-0.6.2.gem (100%)
Fetching: journey-1.0.4.gem (100%)
Fetching: hike-1.2.1.gem (100%)
Fetching: tilt-1.3.3.gem (100%)
Fetching: sprockets-2.2.2.gem (100%)
Fetching: erubis-2.7.0.gem (100%)
Fetching: actionpack-3.2.9.gem (100%)
Fetching: arel-3.0.2.gem (100%)
Fetching: tzinfo-0.3.35.gem (100%)
Fetching: activerecord-3.2.9.gem (100%)
Fetching: activeresource-3.2.9.gem (100%)
Fetching: mime-types-1.19.gem (100%)
Fetching: polyglot-0.3.3.gem (100%)
Fetching: treetop-1.4.12.gem (100%)
Fetching: mail-2.4.4.gem (100%)
Fetching: actionmailer-3.2.9.gem (100%)
Fetching: rake-10.0.2.gem (100%)
Fetching: rack-ssl-1.3.2.gem (100%)
Fetching: thor-0.16.0.gem (100%)
Fetching: json-1.7.5.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing rails:
    ERROR: Failed to build gem native extension.

        /Users/mctesterson/.rvm/rubies/ruby-1.9.3-p327/bin/ruby extconf.rb
creating Makefile

make
compiling generator.c
make: /usr/bin/gcc-4.2: No such file or directory
make: *** [generator.o] Error 1


Gem files will remain installed in /Users/mctesterson/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/json-1.7.5 for inspection.
Results logged to /Users/mctesterson/.rvm/rubies/ruby-1.9.3-p327/lib/ruby/gems/1.9.1/gems/json-1.7.5/ext/json/ext/generator/gem_make.out

It looks like it was looking for my gcc stuff in the wrong place.看起来它在错误的地方寻找我的 gcc 东西。

I ran the following and it worked:我运行了以下命令并且它起作用了:

sudo ln -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2

(looked at this article and found that under Franco's solution: error: failed to build gem native extension when installing rails on mac mountian lion os ) (看了这篇文章,发现在Franco的解决方案下: error: failed to build gem native extension when installed rails on mac mountian lion os

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

相关问题 安装rails时出错错误:无法构建gem本机扩展 - Error installing rails ERROR: 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 在Rails上安装ruby时出错,无法构建gem本机扩展 - Error while installing ruby on rails,Failed to build gem native extension 安装 rails 时出错,无法构建 gem 本机扩展 - Error installing rails, failed to build gem native extension 安装 fcgi 时出现 Rails 错误:无法构建 gem 原生扩展 - Rails error while installing fcgi: Failed to build gem native extension "<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 6.0.0 时出错:无法构建 gem 原生扩展 - Error installing Rails 6.0.0: Failed to build gem native extension 无法构建Gem扩展错误,安装滑轨 - Failed to Build Gem Extension Error Installing rails 无法安装 Rails。 错误:安装导轨时出错:错误:无法构建 gem 原生扩展 - Can't install Rails. ERROR: Error installing rails: ERROR: Failed to build gem native extension
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM