无法使用rvm安装ruby 2.2.0(或任何版本)

时间:2017-07-18 15:18:51

标签: ruby-on-rails ruby xcode rvm

我正在尝试安装ruby 2.2.0但我收到此错误。我试过安装ruby 2.3.3做rvm install 2.3.3并得到类似的错误。我目前正在运行xCode 8.3.3并完成xcode-select install并且所有内容都是最新的。

以下是来自终端的日志:

rvm reinstall 2.2.0 --disable-binary
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/thomasbaldwin/.rvm/rubies/ruby-2.2.0, this may take a while depending on your cpu(s)...
ruby-2.2.0 - #downloading ruby-2.2.0, this may take a while depending on your connection...
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 12.6M  100 12.6M    0     0  7616k      0  0:00:01  0:00:01 --:--:-- 7615k
ruby-2.2.0 - #extracting ruby-2.2.0 to /Users/thomasbaldwin/.rvm/src/ruby-2.2.0....
ruby-2.2.0 - #applying patch /Users/thomasbaldwin/.rvm/patches/ruby/2.2.0/fix_installing_bundled_gems.patch.
ruby-2.2.0 - #applying patch /Users/thomasbaldwin/.rvm/patches/ruby/2.2.0/openssl3.patch.
ruby-2.2.0 - #configuring..
Error running './configure --prefix=/Users/thomasbaldwin/.rvm/rubies/ruby-2.2.0 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --disable-install-doc --enable-shared',
showing last 15 lines of /Users/thomasbaldwin/.rvm/log/1500390685_ruby-2.2.0/configure.log

以下是来自配置文件的日志:

[2017-07-18 11:11:33] ./configure
current path: /Users/thomasbaldwin/.rvm/src/ruby-2.2.0
GEM_HOME=/Users/thomasbaldwin/.rvm/gems/ruby-2.1.5
PATH=/usr/local/opt/coreutils/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/Users/thomasbaldwin/.rvm/gems/ruby-2.1.5/bin:/Users/thomasbaldwin/.rvm/gems/ruby-2.1.5@global/bin:/Users/thomasbaldwin/.rvm/rubies/ruby-2.1.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/local/share/npm/bin:/Users/thomasbaldwin/dev/adt-bundle-mac/sdk/tools:/Users/thomasbaldwin/dev/adt-bundle-mac/sdk/platform-tools:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/bin:/Users/thomasbaldwin/.rvm/bin
GEM_PATH=/Users/thomasbaldwin/.rvm/gems/ruby-2.1.5:/Users/thomasbaldwin/.rvm/gems/ruby-2.1.5@global
command(5): ./configure --prefix=/Users/thomasbaldwin/.rvm/rubies/ruby-2.2.0 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --disable-install-doc --enable-shared
config.guess already exists
config.sub already exists
checking build system type... x86_64-apple-darwin16.6.0
checking host system type... x86_64-apple-darwin16.6.0
checking target system type... x86_64-apple-darwin16.6.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/Users/thomasbaldwin/.rvm/src/ruby-2.2.0':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

关于我做错什么的任何想法......?谢谢!

更新

我尝试使用--with-gcc = clang进行安装,但没有运气

Thomass-MacBook-Pro:maharam thomasbaldwin$ rvm reinstall 2.2.0 --disable-binary --with-gcc=clang
ruby-2.2.0 - #removing src/ruby-2.2.0..
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Warning: found user selected compiler 'clang', this will suppress RVM auto detection mechanisms.
Installing Ruby from source to: /Users/thomasbaldwin/.rvm/rubies/ruby-2.2.0, this may take a while depending on your cpu(s)...
ruby-2.2.0 - #downloading ruby-2.2.0, this may take a while depending on your connection...
ruby-2.2.0 - #extracting ruby-2.2.0 to /Users/thomasbaldwin/.rvm/src/ruby-2.2.0....
ruby-2.2.0 - #applying patch /Users/thomasbaldwin/.rvm/patches/ruby/2.2.0/fix_installing_bundled_gems.patch.
ruby-2.2.0 - #applying patch /Users/thomasbaldwin/.rvm/patches/ruby/2.2.0/openssl3.patch.
ruby-2.2.0 - #configuring..
Error running './configure --prefix=/Users/thomasbaldwin/.rvm/rubies/ruby-2.2.0 --with-gcc=clang --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --disable-install-doc --enable-shared',
showing last 15 lines of /Users/thomasbaldwin/.rvm/log/1500405359_ruby-2.2.0/configure.log
PATH=/usr/local/opt/coreutils/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/Users/thomasbaldwin/.rvm/gems/ruby-2.1.5/bin:/Users/thomasbaldwin/.rvm/gems/ruby-2.1.5@global/bin:/Users/thomasbaldwin/.rvm/rubies/ruby-2.1.5/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/sbin:/usr/local/bin:/usr/local/share/npm/bin:/Users/thomasbaldwin/dev/adt-bundle-mac/sdk/tools:/Users/thomasbaldwin/dev/adt-bundle-mac/sdk/platform-tools:/Library/Java/JavaVirtualMachines/jdk1.8.0_111.jdk/Contents/Home/bin:/Users/thomasbaldwin/.rvm/bin
GEM_PATH=/Users/thomasbaldwin/.rvm/gems/ruby-2.1.5:/Users/thomasbaldwin/.rvm/gems/ruby-2.1.5@global
command(6): ./configure --prefix=/Users/thomasbaldwin/.rvm/rubies/ruby-2.2.0 --with-gcc=clang --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --disable-install-doc --enable-shared
config.guess already exists
config.sub already exists
checking build system type... x86_64-apple-darwin16.6.0
checking host system type... x86_64-apple-darwin16.6.0
checking target system type... x86_64-apple-darwin16.6.0
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... configure: error: in `/Users/thomasbaldwin/.rvm/src/ruby-2.2.0':
configure: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details
There has been an error while running configure. Halting the installation.

0 个答案:

没有答案