athityakumar/colorls

Can't install colorls on Ubuntu 21.04

Best-Adagio opened this issue · 3 comments

Description

First time here. Please be patient if anything relevant is missing.

Here is the situation. I'm trying to install colorls on Ubuntu.

gem install --user-install colorls

and this is what a get as an error:

Building` native extensions. This could take a while...
ERROR:  Error installing colorls:
ERROR: Failed to build gem native extension.

current directory: /var/lib/gems/2.7.0/gems/clocale-0.0.4/ext/clocale
/usr/bin/ruby2.7 -I /usr/local/lib/site_ruby/2.7.0 -r ./siteconf20211024-43841-aiy6p8.rb             extconf.rb
checking for locale.h... yes
checking for setlocale()... yes
checking for strcoll()... yes
checking for strxfrm()... yes
creating Makefile

current directory: /var/lib/gems/2.7.0/gems/clocale-0.0.4/ext/clocale
make DESTDIR\= clean
/var/lib/gems/2.7.0/gems/make-0.3.1/bin/make:4:in `<top (required)>': undefined local    variable or method `make' for main:Object (NameError)
    from /usr/local/bin/make:25:in `load'
    from /usr/local/bin/make:25:in `<main>'

current directory: /var/lib/gems/2.7.0/gems/clocale-0.0.4/ext/clocale
make DESTDIR\=
/var/lib/gems/2.7.0/gems/make-0.3.1/bin/make:4:in `<top (required)>': undefined local     variable or method `make' for main:Object (NameError)
from /usr/local/bin/make:25:in `load'
from /usr/local/bin/make:25:in `<main>'

make failed, exit code 1

Here is the mkmf.log file:

have_header: checking for locale.h... -------------------- yes

"aarch64-linux-gnu-gcc -o conftest -I/usr/include/aarch64-linux-gnu/ruby-2.7.0 -I/usr/include/ruby-2.7.0/ruby/backward -I/usr/include/ruby-2.7.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2   -g -O2 -ffile-prefix-map=/build/ruby2.7-L7Em9C/ruby2.7-2.7.2=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c  -L. -L/usr/lib/aarch64-linux-gnu -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -lruby-2.7  -lm   -lc"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return !!argv[argc];
6: }
/* end */

"aarch64-linux-gnu-gcc -E -I/usr/include/aarch64-linux-gnu/ruby-2.7.0 -I/usr/include/ruby-2.7.0/ruby/backward -I/usr/include/ruby-2.7.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2   -g -O2 -ffile-prefix-map=/build/ruby2.7-L7Em9C/ruby2.7-2.7.2=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC  conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <locale.h>
/* end */

--------------------

have_func: checking for setlocale()... -------------------- yes

"aarch64-linux-gnu-gcc -o conftest -I/usr/include/aarch64-linux-gnu/ruby-2.7.0 -I/usr/include/ruby-2.7.0/ruby/backward -I/usr/include/ruby-2.7.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2   -g -O2 -ffile-prefix-map=/build/ruby2.7-L7Em9C/ruby2.7-2.7.2=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c  -L. -L/usr/lib/aarch64-linux-gnu -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -lruby-2.7  -lm   -lc"
conftest.c: In function ‘t’:
conftest.c:14:57: error: ‘setlocale’ undeclared (first use in this function)
   14 | int t(void) { void ((*volatile p)()); p = (void ((*)()))setlocale; return !p; }
      |                                                         ^~~~~~~~~
conftest.c:14:57: note: each undeclared identifier is reported only once for each function it appears in
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     int (* volatile tp)(void)=(int (*)(void))&t;
 9:     printf("%d", (*tp)());
10:   }
11: 
12:   return !!argv[argc];
13: }
14: int t(void) { void ((*volatile p)()); p = (void ((*)()))setlocale; return !p; }
/* end */

"aarch64-linux-gnu-gcc -o conftest -I/usr/include/aarch64-linux-gnu/ruby-2.7.0 -I/usr/include/ruby-2.7.0/ruby/backward -I/usr/include/ruby-2.7.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2   -g -O2 -ffile-prefix-map=/build/ruby2.7-L7Em9C/ruby2.7-2.7.2=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c  -L. -L/usr/lib/aarch64-linux-gnu -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -lruby-2.7  -lm   -lc"
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     int (* volatile tp)(void)=(int (*)(void))&t;
 9:     printf("%d", (*tp)());
10:   }
11: 
12:   return !!argv[argc];
13: }
14: extern void setlocale();
15: int t(void) { setlocale(); return 0; }
/* end */

--------------------

have_func: checking for strcoll()... -------------------- yes

"aarch64-linux-gnu-gcc -o conftest -I/usr/include/aarch64-linux-gnu/ruby-2.7.0 -I/usr/include/ruby-2.7.0/ruby/backward -I/usr/include/ruby-2.7.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2   -g -O2 -ffile-prefix-map=/build/ruby2.7-L7Em9C/ruby2.7-2.7.2=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c  -L. -L/usr/lib/aarch64-linux-gnu -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -lruby-2.7  -lm   -lc"
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     int (* volatile tp)(void)=(int (*)(void))&t;
 9:     printf("%d", (*tp)());
10:   }
11: 
12:   return !!argv[argc];
13: }
14: int t(void) { void ((*volatile p)()); p = (void ((*)()))strcoll; return !p; }
/* end */

--------------------

have_func: checking for strxfrm()... -------------------- yes

"aarch64-linux-gnu-gcc -o conftest -I/usr/include/aarch64-linux-gnu/ruby-2.7.0 -I/usr/include/ruby-2.7.0/ruby/backward -I/usr/include/ruby-2.7.0 -I. -Wdate-time -D_FORTIFY_SOURCE=2   -g -O2 -ffile-prefix-map=/build/ruby2.7-L7Em9C/ruby2.7-2.7.2=. -fstack-protector-strong -Wformat -Werror=format-security -fPIC conftest.c  -L. -L/usr/lib/aarch64-linux-gnu -L. -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -fstack-protector-strong -rdynamic -Wl,-export-dynamic     -lruby-2.7  -lm   -lc"
checked program was:
/* begin */
 1: #include "ruby.h"
 2: 
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     int (* volatile tp)(void)=(int (*)(void))&t;
 9:     printf("%d", (*tp)());
10:   }
11: 
12:   return !!argv[argc];
13: }
14: int t(void) { void ((*volatile p)()); p = (void ((*)()))strxfrm; return !p; }
/* end */

--------------------

Thanks in advance.

Thanks for opening this issue. Add a brief description of what this issue is, and how to recreate it. Do tag the relevant issue(s) and PR(s) below. If required, add some screenshot(s) to showcase the issue.

  • Relevant Issues : (none)
  • Relevant PRs : (none)
  • Type of issue :
    • [ x] Installation
    • Font-related
    • Feature request
    • Bug in existing feature
    • Developer mode : Code quality / Tests / Documentation
avdv commented

You need to have GNU make (or compatible) installed. It seems you have something else installed in /usr/local/bin/make which points to the globally installed make gem in /var/lib/gems/2.7.0/gems/make-0.3.1/ ?!

Remove this or make sure that GNU make is found doing a lookup in $PATH.

Thanks for the quick reply.

As you can tell, i'm a total noob. Please bear with me on this one. I really wanna do it right.

I think I have done what was required.

After trying to reinstall colorls, this is the message I get:

WARNING:  You don't have /home/username/.local/share/gem/ruby/2.7.0/bin in your PATH,
	  gem executables will not run.

  *******************************************************************
    Changes introduced in colorls

    Sort by dirs  : -sd flag has been renamed to --sd
    Sort by files : -sf flag has been renamed to --sf
    Git status    : -gs flag has been renamed to --gs

    Clubbed flags : `colorls -ald` works
    Help menu     : `colorls -h` provides all possible flag options

    Tab completion enabled for flags

    -t flag : Previously short for --tree, has been re-allocated to sort results by time
    -r flag : Previously short for --report, has been re-allocated to reverse sort results

    Man pages have been added. Checkout `man colorls`.

  *******************************************************************
Successfully installed colorls-1.4.4
Parsing documentation for colorls-1.4.4
Done installing documentation for colorls after 0 seconds
1 gem installed

I use zsh as shell, when I use the colorls command this is what I get:

zsh: command not found: colorls

It's progressing but still not working.

Any idea?

Fixed it.

Added PATH=$PATH:/home/username/.local/share/gem/ruby/2.7.0/bin in .zshrc

Wow, not bad for a noob.

Thanks guys, case close.