ktu*_*nio 33 ruby gem gcc makefile osx-mountain-lion
试图在Mountain Lion上安装一个宝石,但找不到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
Run Code Online (Sandbox Code Playgroud)
ktu*_*nio 90
如果你安装了Xcode,gcc应该可用.检查它的位置:
kamil$ which gcc
/usr/bin/gcc
Run Code Online (Sandbox Code Playgroud)
然后创建一个从gcc-4.2到普通gcc的用户土地符号链接:
kamil$ sudo ln -s ~/bin/gcc /usr/bin/gcc-4.2
Run Code Online (Sandbox Code Playgroud)
(确保用户 - 土地绑定文件夹export PATH=...:$HOME/bin
位于您.bash_profile
或您的路径中.zshrc
.)
之后宝石安装得很好.
Pii*_*ioo 14
使用brew安装简单的apple-gcc42.它生成gcc-4.2.
brew install apple-gcc42
Run Code Online (Sandbox Code Playgroud)
所以我们不需要符号链接,苹果更新可能会删除它们.