postmodern / ruby-install

Installs Ruby, JRuby, TruffleRuby, or mruby
MIT License
1.91k stars 255 forks source link

Installing rubies #355

Closed mhenrixon closed 2 years ago

mhenrixon commented 5 years ago

This computer is on Mac OS X 10.14. Installing rubies has worked before so I suppose it is a problem with upgrading llvm, openssl or some such.

This is the error log for me.

clang-9: error: no input files
configure:3937: $? = 1
configure:3926: clang -qversion >&5
clang-9: error: unknown argument '-qversion'; did you mean '--version'?
clang-9: error: no input files
configure:3937: $? = 1
configure:3957: checking whether the C compiler works
configure:3979: clang  -I/usr/local/opt/llvm/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl/include -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl/lib conftest.c  >&5
configure:3983: $? = 0
configure:4031: result: yes
configure:4034: checking for C compiler default output file name
configure:4036: result: a.out
configure:4042: checking for suffix of executables
configure:4049: clang -o conftest  -I/usr/local/opt/llvm/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl/include -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl/lib conftest.c  >&5
configure:4053: $? = 0
configure:4075: result: 
configure:4097: checking whether we are cross compiling
configure:4105: clang -o conftest  -I/usr/local/opt/llvm/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl/include -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl/lib conftest.c  >&5
conftest.c:9:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
         ^~~~~~~~~
1 error generated.
configure:4109: $? = 1
configure:4116: ./conftest
./configure: line 4118: ./conftest: No such file or directory
configure:4120: $? = 127
configure:4127: error: in `/Users/mikaelhenrikson/src/ruby-2.6.5':
configure:4129: error: cannot run C compiled programs.
If you meant to cross compile, use `--host'.
See `config.log' for more details

## ---------------- ##
## Cache variables. ##
## ---------------- ##

I'm baffled really, it used to work fine.

mhenrixon commented 5 years ago
set -gx EXTRA_CFLAGS "-I/usr/local/opt/openssl/include"
set -gx EXTRA_CXXFLAGS "-I/usr/local/opt/openssl/include"
set -gx EXTRA_LDFLAGS "-L/usr/local/opt/openssl/lib"
# set -gx LDFLAGS "-L/usr/local/opt/readline/lib -L/usr/local/opt/llvm/lib -Wl,-rpath,/usr/local/opt/llvm/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl/lib"
set -gx LDFLAGS "-L/usr/local/opt/readline/lib -L/usr/local/opt/zlib/lib -L/usr/local/opt/openssl/lib"
# set -gx CPPFLAGS "-I/usr/local/opt/readline/include -I/usr/local/opt/llvm/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl/include"
set -gx CPPFLAGS "-I/usr/local/opt/readline/include -I/usr/local/opt/zlib/include -I/usr/local/opt/openssl/include"

# set -g fish_user_paths /usr/local/opt/sqlite/bin /usr/local/opt/openssl/bin /usr/local/opt/llvm/bin $fish_user_paths
set -g fish_user_paths /usr/local/opt/sqlite/bin /usr/local/opt/openssl/bin $fish_user_paths

It seems like removing any llvm shit from my fish profile does the trick so definitely an LLVM problem!

mhenrixon commented 5 years ago

Hmm it worked for ruby 2.6.5 but not for ruby 2.5 or ruby 2.4:

ruby-install -j4 --package-manager brew --cleanup ruby 2.5

Was giving me some trouble when my current ruby was --system if I switch to chruby ruby-2.6.5 the install is fine.

Wondering why older rubies can't be installed when current ruby is system?

havenwood commented 2 years ago

Installing older Rubies on newer systems is often a headache, for sure. Closing since this issue is dated and reflects upstream dependency issues that aren't intended to be addressed at the ruby-install level. Thank you for reporting!