我已经安装了XCode 4.5和命令行工具。然后我安装最新的RVM。当我尝试安装ruby1.9.3时,出现以下错误。看起来像C编译器不能被执行。如何在Mac OS 10.7.5上安装ruby1.9.3?
克里斯$ rvm install ruby
没有可用的二进制红宝石:下载/红宝石1.9.3-P327。 继续编译。请阅读'rvm mount'以获取关于二进制红宝石的更多信息。 将yaml-0.1.4.tar.gz提取到/Users/chris/.rvm/archives 将yaml提取到/Users/chris/.rvm/src/yaml-0.1.4 在/ Users/chris /中配置yaml。 RVM/SRC/YAML-0.1.4。 运行'env LDFLAGS = -L/opt/sm/pkg/active/lib CFLAGS = -I/opt/sm/pkg/active/include CPATH =/opt/sm/pkg/active/include ./configure时出错 - prefix =/Users/chris/.rvm/usr',请阅读/Users/chris/.rvm/log/ruby-1.9.3-p327/yaml/configure.log 在/Users/chris/.rvm/中编译yaml SRC/YAML-0.1.4。 将yaml安装到/Users/chris/.rvm/usr 将Ruby从源代码安装到:/Users/chris/.rvm/rubies/ruby-1.9.3-p327,这可能需要一段时间,具体取决于您的cpu(s) ... ruby-1.9.3-p327 - #下载ruby-1.9.3-p327,这可能需要一段时间,具体取决于您的连接... ruby-1.9.3-p327 - #extracted to/Users/chris /.rvm/src/ruby-1.9.3-p327(已解压) ruby-1.9.3-p327 - #configuring 运行'env LDFLAGS = -L/opt/sm/pkg/active/lib时出错CFLAGS = - I/opt/sm/pkg/active/include CPATH =/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix =/Users/chris/.rvm/rubies/ruby-1.9.3-p327 --with-opt-dir =/Users/chris/.rvm/usr',请阅读/Users/chris/.rvm/log/ruby-1.9.3-p327/configure。日志 运行configure时出错。停止安装。
在日志文件中的内容:
2012年12月17日21点46分44秒]的env LDFLAGS = -L /选择/ SM/PKG /活性/ lib中CFLAGS = -I /选择/ SM/pkg/active/include CPATH =/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix =/Users/chris/.rvm/rubies/ruby-1.9。 3-p327 --with-opt-dir =/Users/chris/.rvm/usr 检查构建系统类型... x86_64-apple-darwin11.4.2 检查主机系统类型... x86_64-apple-darwin11.4.2 检查目标系统类型... x86_64-apple-darwin11.4.2 检查C编译器是否工作... no configure:error:in /Users/chris/.rvm/src/ruby-1.9.3-p327' : configure:error:C compiler can not create executables Seeconfig.log'for more details
然后我试着在https://github.com/kennethreitz/osx-gcc-installer上安装GCC。错误仍然显示。
我也尝试将cmd更改为rvm install 1.9.3 --with-gcc=clang
,但得到相同的错误。
我需要设置一些环境变量吗?或者我错过了什么?
我建议安装MacPorts(http://www.macports.org/)或Homebrew(http://mxcl.github.com/homebrew/)并让它照顾苦差事 – sbooth
I second @sbooth on homebrew http://www.frederico-araujo.com/2011/07/30/installing-rails-on-os-x-lion-with-homebrew-rvm-and-mysql/ –
根据gcc文档,你不能使用gcc + xcode CT。卸载它们然后安装gcc并尝试做任何你需要的操作 –