postmodern / ruby-install

Installs Ruby, JRuby, TruffleRuby, or mruby
MIT License
1.89k stars 250 forks source link

Ruby install 2.6.0 confusing error for Homebrew install #472

Closed PeterKW closed 9 months ago

PeterKW commented 9 months ago

Perhaps I am doing something wrong? I need to install homebrew on Linux in order to use brew install. I have done that before but I don't recognise these errors.

Homebrew says it needs ruby which I managed to install the current version of. Do I need to remove the current version somehow to get the Homebrew dependency?

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
environment: line 453: ldd: command not found
Homebrew requires Ruby 2.6 which was not found on your system.
Homebrew portable Ruby requires Glibc version 2.13 or newer,
and your Glibc version is too old. See:                                                            https://docs.brew.sh/Homebrew-on-Linux#requirements
Please install Ruby 2.6 and add its location to your PATH.
ruby-install ruby 2.6.0 | grep error
.
.
.
11 warnings generated.
file.c:2703:27: error: call to undeclared function 'lutimes'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
 2703 |     if (v->follow) return lutimes(path, tvp);                                                  |                           ^
file.c:2703:27: note: did you mean 'utimes'?
/data/data/com.termux/files/usr/include/sys/time.h:47:5: note: 'utimes' declared here
   47 | int utimes(const char* _Nonnull __path, const struct timeval __times[_Nullable 2]);
      |     ^
1 error generated.
make: *** [Makefile:419: file.o] Error 1                                                         !!! Compiling ruby 2.6.0 failed!
ruby -v
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [aarch64-linux-android]
ruby-install --version                              
ruby-install: 0.9.2

Ah maybe the ruby version being downloaded has the wrong architecture?

postmodern commented 9 months ago

The actual error is a C compilation error due to the headers provided by your system, which appears to be an Android system. Normally, I would recommend report this to https://bugs.ruby-lang.org/, however ruby-2.6.0 has reached End-of-Life and is no longer maintained so I doubt they will fix this. Perhaps try installing a more recent version of CRuby?