我刚刚升级到OS X山狮(已经后悔了)。
有安装json的宝石原生的一些推广的问题。
10.8之前我已经安装命令行工具。 RVM使用Ruby 1.9.2。
升级到10.8,也做了以下的东西:
- 须藤CHOWN -R
whoami
的/ usr /本地 - BREW更新
- 酿造抽头自制/愚弄
- BREW安装苹果gcc42
- 已安装的XCode 4.4
- 安装的命令行工具的XCode 4.4
- 在.bash_profile中出口CC =在/ usr / local / bin目录/ GCC-4.2
- 须藤LN -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2
- 编辑:sudo的Xcode的选-switch /Applications/Xcode.app/Contents/Developer
安装JSON宝石时,我仍然得到以下的输出:
➽ gem install json -v '1.7.4'
Building native extensions. This could take a while...
ERROR: Error installing json:
ERROR: Failed to build gem native extension.
/Users/vincent/.rvm/rubies/ruby-1.9.2-p320/bin/ruby extconf.rb
creating Makefile
make
/usr/bin/gcc-4.2 -I. -I/Users/vincent/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/x86_64-darwin11.3.0 -I/Users/vincent/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1/ruby/backward -I/Users/vincent/.rvm/rubies/ruby-1.9.2-p320/include/ruby-1.9.1 -I. -DJSON_GENERATOR -I/Users/vincent/.rvm/usr/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -O3 -ggdb -Wextra -Wno-unused-parameter -Wno-parentheses -Wpointer-arith -Wwrite-strings -Wno-missing-field-initializers -Wshorten-64-to-32 -Wno-long-long -fno-common -pipe -O3 -Wall -O0 -ggdb -o generator.o -c generator.c
gcc-4.2: error trying to exec '/usr/bin/i686-apple-darwin11-gcc-4.2.1': execvp: No such file or directory
make: *** [generator.o] Error 255
Gem files will remain installed in /Users/vincent/.rvm/gems/ruby-1.9.2-p320@hshmrk/gems/json-1.7.4 for inspection.
Results logged to /Users/vincent/.rvm/gems/ruby-1.9.2-p320@hshmrk/gems/json-1.7.4/ext/json/ext/generator/gem_make.out
任何帮助这里? 如何调试我的构建ENV? 不是专家,当谈到这一点,但我认为JSON宝石安装程序,因为它是使用一个版本的GCC,它不是我的系统和BREW安装程序也不创建上存在无视我的环境。
➽ gcc-4.2
i686-apple-darwin11-gcc-4.2.1: no input files
➽ which gcc-4.2
/usr/local/bin/gcc-4.2
➽ ls /usr/bin/i686-apple-darwin11-gcc-4.2.1
ls: /usr/bin/i686-apple-darwin11-gcc-4.2.1: No such file or directory
我也试过符号链接➽ sudo link /usr/local/bin/gcc-4.2 /usr/bin/i686-apple-darwin11-gcc-4.2.1
。 但是,这给了vfork的超时错误。
编辑:
➽ brew doctor
gcc-4.2: error trying to exec '/usr/bin/i686-apple-darwin11-gcc-4.2.1': execvp: No such file or directory
Warning: X11 is not installed.
You don't have X11 installed as part of your OS X installation.
This is not required for all formulae, but is expected by some.
You can download the latest version of XQuartz from:
https://xquartz.macosforge.org
EDIT2:
并运行的Xcode选的XCode
EDIT3:
sudo xcode-select -switch /usr/bin
sudo ln -sf /usr/bin/llvm-gcc-4.2 /usr/bin/gcc-4.2
这定了! 基本上你告诉OS X上使用的/ usr / bin文件夹编译,然后你链接LLVM-GCC-4.2编译到旧曾经是。 作品! BAM!
来源: http://jtimberman.housepub.org/blog/2012/02/26/xcode-command-line-tools/