Ruby on rails 无法使用rvm安装ruby 2.2.0(或任何版本)
我正在尝试安装ruby 2.2.0,但遇到了这个错误。我试着安装ruby 2.3.3,执行Ruby on rails 无法使用rvm安装ruby 2.2.0(或任何版本),ruby-on-rails,ruby,xcode,rvm,Ruby On Rails,Ruby,Xcode,Rvm,我正在尝试安装ruby 2.2.0,但遇到了这个错误。我试着安装ruby 2.3.3,执行rvm安装2.3.3,但得到了类似的错误。我目前运行的是xCode 8.3.3,并且已经完成了xCode select安装,一切都是最新的 以下是我在终端上的日志: rvm reinstall 2.2.0 --disable-binary Checking requirements for osx. Certificates in '/usr/local/etc/openssl/cert.pem' are
rvm安装2.3.3
,但得到了类似的错误。我目前运行的是xCode 8.3.3,并且已经完成了xCode select安装
,一切都是最新的
以下是我在终端上的日志:
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.
也许你可以试试书中的一些建议。听起来,用gcc=clang指定
--可能会有所帮助。请试试这个@Puhlze我厌倦了使用--with gcc=clang安装,但运气不好。请看我的照片answer@AjayBarot,您是指--with gcc=clang命令吗?我试过了,但没有成功。请参阅我编辑过的答案在安装ruby之前是否安装了xcode命令行工具($xcode select--install
)?