OS X Mountain Lion:gcc-4.2 没有这样的文件或目录 [英] OS X Mountain Lion: gcc-4.2 No such file or directory
本文介绍了OS X Mountain Lion:gcc-4.2 没有这样的文件或目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
尝试在 Mountain Lion 上安装 gem 并且 make 找不到 gcc-4.2:
Tried to install a gem on Mountain Lion and make couldn't find gcc-4.2:
kamil$ gem install posix-spawn -v '0.3.6'
Building native extensions. This could take a while...
ERROR: Error installing posix-spawn:
ERROR: Failed to build gem native extension.
/Users/kamil/.rbenv/versions/1.9.3-p0/bin/ruby extconf.rb
creating Makefile
make
compiling posix-spawn.c
make: gcc-4.2: No such file or directory
make: *** [posix-spawn.o] Error 1
推荐答案
如果你安装了 Xcode,gcc 应该是可用的.检查它在哪里:
If you have Xcode installed, gcc should be available. Check where it is with:
kamil$ which gcc
/usr/bin/gcc
然后创建一个从 gcc-4.2 到普通 gcc 的用户级符号链接:
Then make a user-land symbolic link from gcc-4.2 to plain gcc:
kamil$ sudo ln -s ~/bin/gcc /usr/bin/gcc-4.2
(通过 .bash_profile
或 中的
.)export PATH=...:$HOME/bin
确保用户域绑定文件夹位于您的路径中.zshrc
(Ensure the user-land bind folder is in your path via export PATH=...:$HOME/bin
in your .bash_profile
or .zshrc
.)
Gem 之后安装正常.
Gem installed fine afterwards.
这篇关于OS X Mountain Lion:gcc-4.2 没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文