简体   繁体   English

使用RVM安装Ruby时出错(OSX 10.8)

[英]Error installing Ruby with RVM (OSX 10.8)

When trying to install Ruby 1.9.3 using RVM (rvm install ruby 1.9.3) I get the following error: 尝试使用RVM安装Ruby 1.9.3(rvm install ruby​​ 1.9.3)时,出现以下错误:

Searching for binary rubies, this might take some time.

No binary rubies available for: osx/10.8/x86_64/ruby-1.9.3-p362.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.

Fetching yaml-0.1.4.tar.gz to /Users/christiaan/.rvm/archives
Extracting yaml to /Users/christiaan/.rvm/src/yaml-0.1.4
Configuring yaml in /Users/christiaan/.rvm/src/yaml-0.1.4.

Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --prefix=/Users/christiaan/.rvm/usr', please read /Users/christiaan/.rvm/log/ruby-1.9.3-p362/yaml/configure.log

Compiling yaml in /Users/christiaan/.rvm/src/yaml-0.1.4.

Error running 'make', please read /Users/christiaan/.rvm/log/ruby-1.9.3-p362/yaml/make.log
Installing Ruby from source to: /Users/christiaan/.rvm/rubies/ruby-1.9.3-p362, this may take a while depending on your cpu(s)...
ruby-1.9.3-p362 - #downloading ruby-1.9.3-p362, this may take a while depending on your connection...
ruby-1.9.3-p362 - #extracted to /Users/christiaan/.rvm/src/ruby-1.9.3-p362 (already extracted)
ruby-1.9.3-p362 - #configuring
Error running '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/christiaan/.rvm/rubies/ruby-1.9.3-p362 --with-opt-dir=/Users/christiaan/.rvm/usr', please read /Users/christiaan/.rvm/log/ruby-1.9.3-p362/configure.log

There has been an error while running configure. Halting the installation.

I've tried all the tips from similar questions, but can't seem to fix this. 我已经尝试过类似问题的所有技巧,但似乎无法解决此问题。

YAML Log (first error log produced): YAML日志(产生的第一个错误日志):

[2012-12-28 16:18:06] env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --prefix=/Users/christiaan/.rvm/usr
current path: /Users/christiaan/.rvm/src/yaml-0.1.4
command(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/christiaan/.rvm/usr
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for a thread-safe mkdir -p... config/install-sh -c -d
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for gcc... /usr/local/bin/gcc-4.2
checking whether the C compiler works... no
configure: error: in `/Users/christiaan/.rvm/src/yaml-0.1.4':
configure: error: C compiler cannot create executables
See `config.log' for more details

RVM Log (second error log produced): RVM日志(产生第二个错误日志):

[2012-12-28 16:18:08] 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/christiaan/.rvm/rubies/ruby-1.9.3-p362 --with-opt-dir=/Users/christiaan/.rvm/usr
current path: /Users/christiaan/.rvm/src/ruby-1.9.3-p362
command(7): 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/christiaan/.rvm/rubies/ruby-1.9.3-p362 --with-opt-dir=/Users/christiaan/.rvm/usr
checking build system type... x86_64-apple-darwin12.2.0
checking host system type... x86_64-apple-darwin12.2.0
checking target system type... x86_64-apple-darwin12.2.0
checking for C compiler default output file name... 
configure: error: C compiler cannot create executables
See `config.log' for more details.

Your main issue is: 您的主要问题是:

configure: error: C compiler cannot create executables

So search for solutions to that problem. 因此,寻找解决该问题的方法。 Like: 喜欢:

rvm install 1.9.3 --with-gcc=clang

Other examples: 其他例子:

It is a duplicate, there are already few answers for this but I have made the fix also into RVM, make sure to run rvm get head first and read the output - the fix is displayed there. 它是重复的,对此的答案已经很少了,但是我也将修复程序放入RVM中,请确保先运行rvm get head并读取输出-修复程序将显示在此处。

This problem is also reported back to RailsInstaller: https://github.com/railsinstaller/railsinstaller-nix/issues/10 此问题也已报告回RailsInstaller: https : //github.com/railsinstaller/railsinstaller-nix/issues/10

Xcode->Preferences Xcode->首选项

Check "Command line tools" 检查“命令行工具”

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM