文章都是从我的个人博客上转载过来的,大家可以点击我的个人博客.

www.iwangzheng.com

mac上安装rails的时候报错,

安装rails的在终端执行了一句命令:

$sudo gem install rails

报错了,报错信息为

clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]

完整的执行过程及报错信息如下:

angela@angeladeMacBook-Air:~$sudo gem install rails

Password:

Building native extensions.  This could take a while...

ERROR:  Error installing rails:

ERROR: Failed to build gem native extension.

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb

creating Makefile

make "DESTDIR="

compiling generator.c

linking shared-object json/ext/generator.bundle

clang: error: unknown argument: '-multiply_definedsuppress' [-Wunused-command-line-argument-hard-error-in-future]

clang: note: this will be a hard error (cannot be downgraded to a warning) in the future

make: *** [generator.bundle] Error 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/json-1.8.1 for inspection.

Results logged to /Library/Ruby/Gems/2.0.0/gems/json-1.8.1/ext/json/ext/generator/gem_make.out

原因很简单,

Xcode 5.1中的苹果编译器将不认识的命令行视为错误行为。这类报错常出现在ruby和python的安装过程中,因为这两类程序中,很多编译语句较为特殊。

解决方案就是在安装语句前面加上这句

ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future ,

以安装rails为例,使用以下的语句:

$ARCHFLAGS=-Wno-error=unused-command-line-argument-hard-error-in-future gem install rails

关于mac安装rails报错clang: error: unknown argument的更多相关文章

  1. (已解决)Xcode 运行报错: clang: error: unknown argument: '-websockets'

    报错内容: 解决办法:

  2. 安装 R 包报错 clang: error: unsupported option '-fopenmp' 的解决方法

    MacOS 上安装 R 包 install.packages("data.table") 后面提示是否安装需要编译的版本: Do you want to install from ...

  3. Mac Angular打包报错xcode-select: error: tool 'xcodebuild' requires Xcode

    Mac Angular打包报错: Error: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer ...

  4. Mac安装MySQL-python报错解决

    Mac安装MySQL-pyhton报错 今天在Mac上安装MySQL-python报错,搜遍网络都说什么mysql config路径问题,但是都不行. 解决方案 一开始遇到的问题是: Complete ...

  5. linux下安装php报错configure: error: Cannot find MySQL header files under /usr/include/mysql.

    linux下安装php报错configure: error: Cannot find MySQL header files under /usr/include/mysql. 2013-03-04 1 ...

  6. 【原】xcode5.0升级5.1遇到的clang: error: unknown argument: '-fobj-arc'错误

    XCODE5.0升到XCODE5.1后LLVM也从5.0升到5.1,工程报下面的错误了: clang: error: unknown argument: '-fobj-arc' [-Wunused-c ...

  7. iOS开展-clang: error: unknown argument: '-websockets'解决方案

    问题: 昨天莫名其妙Xcode自己主动升级,那么今天之前执行project什么时候,不知怎的,他们都获得了. 错误内容: clang: error: unknown argument: '-webso ...

  8. Mac安装MAT报错问题

    安装mat报错,提示在/.eclipse/1528649425_macosx_cocoa_x86_64/configuration/1539332382530.log路径下查看错误日志, 原因是/pr ...

  9. mac安装MySQL-Python报错

    报错内容主要是: EnvironmentError: mysql_config not found Command "python setup.py egg_info" faile ...

随机推荐

  1. 4G时代的抢钱之道

    最近最大的事件恐怕就是移动的4G上线了,50元600M起计价,上网速度最高理论到达100Mbps,相当于一秒下载10MB的数据,或者是一分钟下载一张VCD(600M)电影. 当然,对于这样的流量套餐, ...

  2. SQL温故系列两篇(一)

    1.不允许保存更改.您所做的更改要求删除并重新创建以下表 关于SQL2008 “不允许保存更改.您所做的更改要求删除并重新创建以下表. 打开SQL SERVER 2008 工具-->选项--&g ...

  3. 文件夹文件遍历并插入数据库的操作,IO Directory File的递归操作

    在我们管理内容管理系统时,数据量大时,对机器的依赖性就比较强了,比如,我要将一个文件夹中的很多图片上传到网站,一个个上传会很花时间,就想到了通过遍历文件夹得到文件名,并将路径与文件保存到数据库中对应的 ...

  4. linux中的数值运算

    一.declare 作用:声明变量类型,bash默认变量为字符串类型的,并且字符串在拼接时直接拼接,不需要加号 使用方法: 二.数值运算 加法运算 a= b= c=$(($a+$b)) echo $c

  5. JAVA中的NIO(二)

    一.内存文件映射 内存文件映射允许我们创建和修改那些因为太大而不能放入内存中的文件.有了内存文件映射,我们就可以假定整个文件都在内存中,而且可以完全把文件当作数组来访问. package com.dy ...

  6. 标准IDispose模式浅析

    DoNet资源 众所周知,.Net内存管理分托管资源和非托管资源,把内存中的对象按照这两种资源划分,然后由GC负责回收托管资源(Managed Resource),而对于非托管资源来讲,就需要程序员手 ...

  7. window下为apache配置ssl证书

    转载自 子非鱼 的博客稍作修改 第一步:依赖 配置Apache服务器支持https协议和SSL证书,最基本的要求是Apache包含openssl模块.还好apache/bin目录下有libeay32. ...

  8. .Net MVC中访问PC网页时,自动切换到移动端对应页面

    随着移动端的流行,越来越的网站,除了提供PC网页之外,也提供了移动端的H5页面,手机在访问www.xxx.com的时候,能自动跳转到mobile.xxx.com.网上很多在实现时也能使用JS直接进行跳 ...

  9. codevs 1360 xth砍树 线段树不能再水的题了

    连标记都不用打.. #include<cstdio> #include<cstring> #include<algorithm> using namespace s ...

  10. Java-日期转换

    如下: package 时间日期类; import java.text.SimpleDateFormat; import java.util.Date; public class 日期格式转换 { / ...