ruby-on-rails - clang:错误:无法执行命令:段错误:11

标签 ruby-on-rails ruby xcode clang

对不起我的英语。我在安装 json gem 时遇到了 clang 问题。 我安装了 xcode、xcode 命令行工具等。我在 stackoverflow、google 中找不到问题,我也不知道。 我有带有 xcode 6.1 的 Mavericks 10.9.4。 我尝试了我在 stackoverflow、google 中找到的所有内容。 日志:

Building native extensions.  This could take a while...
ERROR:  Error installing json:
ERROR: Failed to build gem native extension.

/Users/terrry/.rvm/rubies/ruby-2.0.0-p576/bin/ruby extconf.rb
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling generator.c
Stack dump:
0.  Program arguments:    /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -cc1 -triple x86_64-apple-macosx10.7.0 -emit-obj -disable-free -disable-llvm-verifier -main-file-name generator.c -mrelocation-model pic -pic-level 2 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 241.9 -coverage-file /Users/terrry/.rvm/gems/ruby-2.0.0-p576/gems/json-1.8.1/ext/json/ext/generator/generator.o -resource-dir  /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/../lib/clang/6.0 -D JSON_GENERATOR -D _XOPEN_SOURCE -D _DARWIN_C_SOURCE -D _DARWIN_UNLIMITED_SELECT -D _REENTRANT -I . -I /Users/terrry/.rvm/rubies/ruby-2.0.0-p576/include/ruby-2.0.0/x86_64-darwin13.4.0 -I /Users/terrry/.rvm/rubies/ruby-2.0.0-p576/include/ruby-2.0.0/ruby/backward -I /Users/terrry/.rvm/rubies/ruby-2.0.0-p576/include/ruby-2.0.0 -I . -I /Users/travis/.sm/pkg/active/include -O3 -fdebug-compilation-dir /Users/terrry/.rvm/gems/ruby-2.0.0-p576/gems/json-1.8.1/ext/json/ext/generator -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -mstackrealign -fblocks -fobjc-runtime=macosx-10.7.0 -fencode-extended-block-signature -fno-common -fdiagnostics-show-option -vectorize-loops -vectorize-slp -o generator.o -x c generator.c 
1.<eof> parser at end of file
2.  Code generation
3.  Running pass 'Function Pass Manager' on module 'generator.c'.
4.  Running pass 'X86 DAG->DAG Instruction Selection' on function '@cState_initialize'
 clang: error: unable to execute command: Segmentation fault: 11
 clang: error: clang frontend command failed due to signal (use -v to see invocation)
 Apple LLVM version 6.0 (clang-600.0.54) (based on LLVM 3.5svn)
 Target: x86_64-apple-darwin13.1.0
 Thread model: posix
 clang: note: diagnostic msg: PLEASE submit a bug report to        http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source,   and associated run script.
 clang: note: diagnostic msg: 
   ********************

    PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
    Preprocessed source(s) and associated run script(s) are located at:
    clang: note: diagnostic msg:/var/folders/6g/
     z_zh4w3n1vddfmvbct9205600000gn/T/generator-4b740d.c
    clang: note: diagnostic msg: /var/folders/6g/z_zh4w3n1vddfmvbct9205600000gn/T/generator- 4b740d.sh
  clang: note: diagnostic msg: 

   ********************
   make: *** [generator.o] Error 254

   make failed, exit code 2

   Gem files will remain installed in /Users/terrry/.rvm/gems/ruby-2.0.0-p576/gems/json-1.8.1 for inspection.
   Results logged to /Users/terrry/.rvm/gems/ruby-2.0.0-p576/extensions/x86_64-darwin-13/2.0.0-static/json-1.8.1/gem_make.out

最佳答案

在 clang 下,我在编译一个 .c 文件时收到了类似的错误,该文件的一行长度超过 C99 标准允许的最大长度:4,095 个字符。错误消息在这里并不是很有用。

关于ruby-on-rails - clang:错误:无法执行命令:段错误:11,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26511806/

相关文章:

iphone - 当前ChildView Controller

iphone - xcode 中架构 armv7 的 undefined symbol

javascript - 单选按钮(带点击事件)不在 Firefox 中传递参数

ruby-on-rails - 使用单例类动态覆盖/添加 ActiveRecord 关联

mysql - 查询以查找日期介于开始日期和结束日期之间的记录,其中日期可能会重置为 0

mysql - ruby MySQL 返回#<Mysql :0x000000016f3780> and not nil

ruby - 如何在 Ruby 中查询 Criteo REST API v2?

ruby-on-rails - 如何编写和继承 ActionController::TestCase 的抽象子类

python - 所有动态语言都有循环导入问题吗?

iphone - UITableView 搜索后应用程序崩溃