Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/macos/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
c编译器不';t工作ruby安装_Ruby_Macos_Gcc_Rbenv - Fatal编程技术网

c编译器不';t工作ruby安装

c编译器不';t工作ruby安装,ruby,macos,gcc,rbenv,Ruby,Macos,Gcc,Rbenv,我遵循指南安装多个ruby版本 我让我的C编译器正常工作,直到几天前我执行了下面的命令。我不记得我想做什么了。这只是猜测,几天前我确实把GCC搞砸了,这可能就是问题所在。如果我猜错了,请纠正我。正如所有这些命令所说:删除-r gcc临时文件 注意:此错误仅在尝试安装1.8.7-p358版本时显示。对于1.9.3-p125,它可以正常工作 当我尝试使用rbenv安装ruby1.8.7-p358时 正在检查C编译器是否正常工作…否 ❯ rbenv install 1.8.7-p358 Downloa

我遵循指南安装多个ruby版本

我让我的C编译器正常工作,直到几天前我执行了下面的命令。我不记得我想做什么了。这只是猜测,几天前我确实把GCC搞砸了,这可能就是问题所在。如果我猜错了,请纠正我。正如所有这些命令所说:删除-r gcc临时文件

注意:此错误仅在尝试安装1.8.7-p358版本时显示。对于1.9.3-p125,它可以正常工作

当我尝试使用rbenv安装ruby1.8.7-p358时

正在检查C编译器是否正常工作…否

❯ rbenv install 1.8.7-p358
Downloading ruby-1.8.7-p358.tar.bz2...
-> https://cache.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7-p358.tar.bz2
Installing ruby-1.8.7-p358...

BUILD FAILED (OS X 10.11.3 using ruby-build 20160228)

Inspect or clean up the working tree at /var/folders/5n/ghyfb6n9387_h2w5ycg9pd980000gn/T/ruby-build.20160319044654.46596
Results logged to /var/folders/5n/ghyfb6n9387_h2w5ycg9pd980000gn/T/ruby-build.20160319044654.46596.log

Last 10 log lines:
/var/folders/5n/ghyfb6n9387_h2w5ycg9pd980000gn/T/ruby-build.20160319044654.46596/ruby-1.8.7-p358 /var/folders/5n/ghyfb6n9387_h2w5ycg9pd980000gn/T/ruby-build.20160319044654.46596 ~/.rbenv
configure: WARNING: unrecognized options: --with-readline-dir
checking build system type... i686-apple-darwin15.3.0
checking host system type... i686-apple-darwin15.3.0
checking target system type... i686-apple-darwin15.3.0
checking whether the C compiler works... no
configure: error: in `/var/folders/5n/ghyfb6n9387_h2w5ycg9pd980000gn/T/ruby-build.20160319044654.46596/ruby-1.8.7-p358':
configure: error: C compiler cannot create executables
See `config.log' for more details.
make: *** No targets specified and no makefile found.  Stop.
试试这个:

也许您缺少一些可以用来编译C程序的包。 尝试在终端上运行这些命令

sudo apt-get update
sudo apt-get install build-essential
对于OSX

brew uninstall gcc46
brew install apple-gcc42

我正在使用OSX查看标签
brew uninstall gcc46
brew install apple-gcc42