0

I'm trying to install ruby 2.2.0 but I'm getting this error. I've tried install ruby 2.3.3 doing rvm install 2.3.3 and get a similar error. I'm currently running xCode 8.3.3 and have done xcode-select install and everything is up to date.

Here are my logs from the terminal:

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

And here are my logs from the config file:

[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

Any ideas as to what I'm doing wrong..? Thanks!

UPDATE

I tried installing using the --with-gcc=clang but no luck

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.
Thomas
  • 2,356
  • 7
  • 23
  • 59
  • Maybe try some of the suggestions in https://stackoverflow.com/questions/19594719/install-any-version-of-ruby-with-rvm-on-mavericks. It sounds like specifying `--with-gcc=clang` might help. – Puhlze Jul 18 '17 at 15:37
  • Please try this. https://stackoverflow.com/questions/19594719/install-any-version-of-ruby-with-rvm-on-mavericks – Ajay Barot Jul 18 '17 at 16:58
  • @Puhlze I tired installing using the --with-gcc=clang but no luck. Please look at my edited answer – Thomas Jul 18 '17 at 19:18
  • @AjayBarot, are you referring to the --with-gcc=clang command? I tried but no luck. Please refer to my edited answer – Thomas Jul 18 '17 at 19:18
  • @Thomas: Please join me in this chat room. https://chat.stackoverflow.com/rooms/149523/room-for-abprime-and-thomas – Ajay Barot Jul 18 '17 at 19:26
  • 1
    Did you install xcode commandline tools( `$ xcode-select --install `) before installing ruby ? – uday Jul 18 '17 at 20:26

0 Answers0