athityakumar / colorls

A Ruby gem that beautifies the terminal's ls command, with color and font-awesome icons. :tada:
MIT License
4.9k stars 387 forks source link

Installation problem on Windows. MSYS2 #605

Open artemhp opened 11 months ago

artemhp commented 11 months ago

Description

Hello community, I wish to try this amazing tool on my configuration: Windows 11 + MSYS2 + ZSH

❯ echo $0
zsh
❯ echo $SHELL
/usr/bin/zsh
❯ ruby -v
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [x86_64-cygwin]
❯ gem install colorls
Building native extensions. This could take a while...
ERROR:  Error installing colorls:
        ERROR: Failed to build gem native extension.

    current directory: /home/deiku/.local/share/gem/ruby/3.2.0/gems/clocale-0.0.4/ext/clocale
/usr/bin/ruby.exe extconf.rb
checking for locale.h... *** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=/usr/bin/$(RUBY_BASE_NAME)
        --with-locale-dir
        --without-locale-dir
        --with-locale-include
        --without-locale-include=${locale-dir}/include
        --with-locale-lib
        --without-locale-lib=${locale-dir}/lib
/usr/lib/ruby/3.2.0/mkmf.rb:490:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.

        from /usr/lib/ruby/3.2.0/mkmf.rb:616:in `block in try_compile'
        from /usr/lib/ruby/3.2.0/mkmf.rb:565:in `with_werror'
        from /usr/lib/ruby/3.2.0/mkmf.rb:616:in `try_compile'
        from /usr/lib/ruby/3.2.0/mkmf.rb:1157:in `block in have_header'
        from /usr/lib/ruby/3.2.0/mkmf.rb:989:in `block in checking_for'
        from /usr/lib/ruby/3.2.0/mkmf.rb:354:in `block (2 levels) in postpone'
        from /usr/lib/ruby/3.2.0/mkmf.rb:324:in `open'
        from /usr/lib/ruby/3.2.0/mkmf.rb:354:in `block in postpone'
        from /usr/lib/ruby/3.2.0/mkmf.rb:324:in `open'
        from /usr/lib/ruby/3.2.0/mkmf.rb:350:in `postpone'
        from /usr/lib/ruby/3.2.0/mkmf.rb:988:in `checking_for'
        from /usr/lib/ruby/3.2.0/mkmf.rb:1156:in `have_header'
        from extconf.rb:9:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /home/deiku/.local/share/gem/ruby/3.2.0/extensions/x86_64-cygwin/3.2.0/clocale-0.0.4/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /home/deiku/.local/share/gem/ruby/3.2.0/gems/clocale-0.0.4 for inspection.
Results logged to /home/deiku/.local/share/gem/ruby/3.2.0/extensions/x86_64-cygwin/3.2.0/clocale-0.0.4/gem_make.out

I'm not familiar with Ruby, can you please help guide me how can I install and try it?

avdv commented 11 months ago

Hi.

Did you have a look at the /home/deiku/.local/share/gem/ruby/3.2.0/extensions/x86_64-cygwin/3.2.0/clocale-0.0.4/mkmf.log file to see what's going wrong?

As it said, you need to install development tools first, ie. you need a C compiler and make installed. If I am not mistaken you can install these things with the apt tool in MSYS2...

ynnekkram commented 9 months ago

This is what you want:

sudo apt-get install build-essential