OS X Mountain Lionにアップグレードしました(すでに後悔しています)。
jsongemのネイティブ拡張機能のインストールに問題があります。
10.8より前は、コマンドラインツールをインストールしていました。Ruby1.9.2を使用したRVM。
10.8にアップグレードし、次のことを行いました。
- sudo chown -R
whoami
/ usr / local - 醸造の更新
- ブリュータップ自作/デュープ
- brew install apple-gcc42
- インストールされたXCode4.4
- XCode4.4用にインストールされたコマンドラインツール
- CC = / usr / local / bin/gcc-4.2をbash_profileにエクスポートします
- sudo ln -s /usr/local/bin/gcc-4.2 /usr/bin/gcc-4.2
- 編集:sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
json gemをインストールしても、次の出力が得られます。
➽ 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
ここで何か助けはありますか?ビルド環境をデバッグするにはどうすればよいですか?これに関しては専門家ではありませんが、json gemインストーラーは、システムに存在しないバージョンの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
これで修正されました!基本的に、OSXに/usr / binフォルダーを使用してコンパイルするように指示してから、llvm-gcc-4.2コンパイラーを古いコンパイラーがあった場所にリンクします。動作します!バム!
ソース: http: //jtimberman.housepub.org/blog/2012/02/26/xcode-command-line-tools/