1
votes

While installing ruby with:

rvm install 2.1.2

I am getting this error.

And I have also tried building ruby 2.1.2 and other versions as well from source, but I am getting the same error while running:

./configure


OSX Version: 10.14.2 (18C54)
Rvm Version: 1.29.4

This error started coming up after I upgraded to OSX Mojave.


Logs:

ruby-2.1.2 - #removing src/ruby-2.1.2 - please wait
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.14/x86_64/ruby-2.1.2.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates bundle '/usr/local/etc/openssl/cert.pem' is already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/shubhams/.rvm/rubies/ruby-2.1.2, this may take a while depending on your cpu(s)...
ruby-2.1.2 - #downloading ruby-2.1.2, this may take a while depending on your connection...
ruby-2.1.2 - #extracting ruby-2.1.2 to /Users/shubhams/.rvm/src/ruby-2.1.2 - please wait
ruby-2.1.2 - #applying patch
/Users/shubhams/.rvm/patches/ruby/2.1.2/openssl3.patch - please wait ruby-2.1.2 - #configuring - please wait
Error running './configure --prefix=/Users/shubhams/.rvm/rubies/ruby-2.1.2 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --disable-install-doc --enable-shared',
please read /Users/shubhams/.rvm/log/1544095614_ruby-2.1.2/configure.log
There has been an error while running configure. Halting the installation.


Log inside "/Users/shubhams/.rvm/log/1544095614_ruby-2.1.2/configure.log":

....
checking for long long... yes
checking for off_t... yes
checking char bit... 8
checking size of int... 0
checking size of short... 0
checking size of long... 0
checking size of long long... configure: error: in
/Users/shubhams/.rvm/src/ruby-2.1.2': configure: error: cannot compute sizeof (long long) Seeconfig.log' for more details

Thanks.

1
Try renaming your /usr/local/include to /usr/local/include_old & then try again.Aaditya Maheshwari
Thanks @AadityaMaheshwari that seemed to work for me. Can you explain why?matt freake

1 Answers

1
votes

As noted in the comments, renaming the /usr/local/include directory does solve this particular issue. This works because the installer script can no longer find the file causing the problem, previously located in the folder formerly known as /usr/local/include.

While this works, it is likely you'll later encounter issues with homebrew formulaes (stuff already installed on your machine via homebrew).

Solution:

Although this may not always be the case, I simply needed to delete /usr/local/include/stdint.h