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,并且找不到gcc-4.2:
kamil $ gem install posix -spawn -v'0.3.6'
构建原生扩展。这可能需要一段时间...
错误:安装posix-spawn错误:
错误:无法构建gem本机扩展。
/Users/kamil/.rbenv/versions/1.9.3-p0/bin/ruby extconf.rb
创建Makefile
make
编译posix-spawn.c
make:gcc-4.2:没有这样的文件或目录
make:*** [posix-spawn.o]错误1
解决方案
如果您安装了Xcode,gcc应该可用。检查它在哪里:
kamil $哪个gcc
/ usr / bin / gcc
code>
然后建立一个从gcc-4.2到纯gcc的user-land符号链接:
kamil $ sudo ln -s〜/ bin / gcc /usr/bin/gcc-4.2
(确保在您的路径中通过 export PATH = ...:$ HOME / bin
在您的路径中 .bash_profile
或 .zshrc
。)
安装了Gem罚款后。
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
解决方案
If you have Xcode installed, gcc should be available. Check where it is with:
kamil$ which gcc
/usr/bin/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
(Ensure the user-land bind folder is in your path via export PATH=...:$HOME/bin
in your .bash_profile
or .zshrc
.)
Gem installed fine afterwards.
这篇关于OS X Mountain Lion:gcc-4.2没有这样的文件或目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文