我正在试着安装红宝石"yajl ruby“。我运行的是MacOS10.7.4和Ruby 1.8.7 (2011-12-28补丁级别357) universal-darwin11.0。当我运行时:
sudo gem install yajl-ruby我得到以下输出:
Building native extensions. This could take a while...
ERROR: Error installing yajl-ruby:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
creating Makefile
make
gcc -I. - I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe - fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -Wall -funroll-loops -c yajl.c
make: gcc: No such file or directory
make: *** [yajl.o] Error 1
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/yajl-ruby-1.1.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/yajl-ruby-1.1.0/ext/yajl/gem_make.out要使安装正常,我需要做些什么?
发布于 2013-05-03 14:12:06
试试这个:
$ sudo ln -s /usr/bin/llvm-gcc /usr/bin/gcc-4.2
发布于 2012-11-26 00:11:44
这有点麻烦,但是你有没有考虑过使用RVM来管理你的Ruby版本?因为你是在OS机器上工作,我假设它是你的开发机器,所以有一个系统范围的gem可能不是什么大问题。RVM更改了安装gem的路径,使其与正在使用的Ruby版本相关,并且,由于这些路径是用户目录的本地路径,您不需要使用sudo,从而避免了潜在的权限错误,这就是我怀疑发生的情况。
我说我怀疑这是权限错误,因为丢失的文件表明某些内容没有写入预期的位置。不过,这只是一次偶然的尝试。或者,您也可以尝试切换到root并在那里安装gem,但这很难看。
发布于 2013-03-15 07:41:29
我在安装yajl-ruby时遇到了类似的错误。
错误是/Developer/usr/bin不可用。执行"ln -s /Applications/Xcode.app/Contents/Developer/usr/ /Developer/usr“修复了错误。
下面是我看到的具体错误:
gem install yajl-ruby
Building native extensions. This could take a while...
ERROR: Error installing yajl-ruby:
ERROR: Failed to build gem native extension.
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby extconf.rb
creating Makefile
make
xcrun cc -I. -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/universal-darwin11.0 -I. -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -fno-common -arch i386 -arch x86_64 -g -Os -pipe -fno-common -DENABLE_DTRACE -fno-common -pipe -fno-common -Wall -funroll-loops -c yajl.c
sh: /Developer/usr/bin/xcodebuild: No such file or directory
/Developer/usr/bin/xcodebuild fails with 32512 - Unknown error: 32512
make: *** [yajl.o] Error 69
Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/yajl-ruby-1.1.0 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/yajl-ruby-1.1.0/ext/yajl/gem_make.outhttps://stackoverflow.com/questions/13548007
复制相似问题