Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/ruby/22.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
Ruby on rails 无法使用RVM安装Ruby_Ruby On Rails_Ruby_Xcode_Rvm - Fatal编程技术网

Ruby on rails 无法使用RVM安装Ruby

Ruby on rails 无法使用RVM安装Ruby,ruby-on-rails,ruby,xcode,rvm,Ruby On Rails,Ruby,Xcode,Rvm,我在用RVM安装Ruby时遇到了问题,而这一个让我很为难。我使用最新的XCode和XCode命令行工具在OS Mavericks上运行。据我所知,我在另一台机器上安装了相同的装置,没有任何问题 RVM的安装似乎没有问题 在尝试rvm安装2.1时,我收到以下错误消息: ruby-2.1.1 - #removing src/ruby-2.1.1.. Searching for binary rubies, this might take some time. No binary rubies ava

我在用RVM安装Ruby时遇到了问题,而这一个让我很为难。我使用最新的XCode和XCode命令行工具在OS Mavericks上运行。据我所知,我在另一台机器上安装了相同的装置,没有任何问题

RVM的安装似乎没有问题

在尝试rvm安装2.1时,我收到以下错误消息:

ruby-2.1.1 - #removing src/ruby-2.1.1..
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.9/x86_64/ruby-2.1.1.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' already are up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/user/.rvm/rubies/ruby-2.1.1, this may take a while depending on your cpu(s)...
ruby-2.1.1 - #downloading ruby-2.1.1, this may take a while depending on your connection...
ruby-2.1.1 - #extracting ruby-2.1.1 to /Users/user/.rvm/src/ruby-2.1.1...
ruby-2.1.1 - #applying patch /Users/user/.rvm/patches/ruby/changeset_r45225.diff.
ruby-2.1.1 - #applying patch /Users/user/.rvm/patches/ruby/changeset_r45240.diff.
ruby-2.1.1 - #configuring.

Error running './configure --prefix=/Users/user/.rvm/rubies/ruby-2.1.1 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --enable-shared',
showing last 15 lines of /Users/user/.rvm/log/1394918736_ruby-2.1.1/configure.log
[2014-03-15 21:25:55] ./configure
current path: /Users/user/.rvm/src/ruby-2.1.1
PATH=/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/user/.rvm/bin
command(4): ./configure --prefix=/Users/user/.rvm/rubies/ruby-2.1.1 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --enable-shared
checking build system type... x86_64-apple-darwin13.1.0
checking host system type... x86_64-apple-darwin13.1.0
checking target system type... x86_64-apple-darwin13.1.0
<stdin>:2:3: error: #error premature clang
        #error premature clang
         ^
1 error generated.
configure: error: clang version 3.0 or later is required
There has been an error while running configure. Halting the installation.

我听从了这里的建议,现在花了几个小时上网,但还没有一个解决方案对我有效。任何想法和想法都是最受欢迎的——这一点让我感到困惑

一旦拥有gcc46 insall,您就需要将其设置为默认编译器。您可以在此处找到有关不同方法的信息:


然后,如输出所示,使用
brew点击--repair
brew doctor
,这将为您提供更多信息。

谢谢。我对永久更改默认值犹豫不决,但以下命令对我有效:
sudo rvm install 2.1--with gcc=gcc-4.2
Checking requirements for osx.
Installing requirements for osx.
Updating system....
Installing required packages: gcc46.....
Error running 'requirements_osx_brew_libs_install gcc46',
showing last 15 lines of /Users/user/.rvm/log/1394919146/package_install_gcc46.log
+ case "$1" in
+ [[ -t 1 ]]
+ return 1
+ printf %b 'There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.

Check Homebrew requirements https://github.com/mxcl/homebrew/wiki/Installation\n'
There were package installation errors, make sure to read the log.

Try `brew tap --repair` and make sure `brew doctor` looks reasonable.

Check Homebrew requirements https://github.com/mxcl/homebrew/wiki/Installation
+ case "$_system_version" in
+ return 1
Requirements installation failed with status: 1.