inukshuk / anystyle-cli

AnyStyle Command Line Interface
BSD 2-Clause "Simplified" License
57 stars 8 forks source link

anystyle-cli installed and located but not found #17

Closed tylerandrewscott closed 1 year ago

tylerandrewscott commented 1 year ago

I apologize if I am missing something obvious here -- I have previously used anystyle + anystyle-cli, but having updated to the new versions I cannot get anystyle-cli to work. It successfully installed using > gem install anystyle-cli, and shows up like I would expect when calling > gem list, but does not show up if I call >gem which anystyle-cli and the "sh: anystyle: command not found" message when trying to actually use the CLI tool. Anystyle does work interactively in ruby. I know that often this sort of thing ends up being a path issue, but I'm confused in this case because the anystyle-cli gem shows up where I expect, alongside anystyle, but one is found and the other is not.

(base) tscott@macbook-pro-126 anystyle % ruby --version
ruby 3.2.0 (2022-12-25 revision a528908271) [x86_64-darwin22]

(base) tscott@macbook-pro-126 ~ % gem list anystyle

*** LOCAL GEMS ***

anystyle (1.4.0)
anystyle-cli (1.4.1)
anystyle-data (1.3.0)
(base) tscott@macbook-pro-126 ~ % gem which anystyle 
/usr/local/lib/ruby/gems/3.2.0/gems/anystyle-1.4.0/lib/anystyle.rb
(base) tscott@macbook-pro-126 ~ % gem which anystyle-cli 
ERROR:  Can't find Ruby library file or shared library anystyle-cli
(base) tscott@macbook-pro-126 anystyle % gem list -d anystyle-cli

*** LOCAL GEMS ***

anystyle-cli (1.4.1)
    Author: Sylvester Keil
    Homepage: http://anystyle.io
    License: BSD-2-Clause
    Installed at: /usr/local/lib/ruby/gems/3.2.0

    AnyStyle CLI
inukshuk commented 1 year ago

The gem which command lists files that you can require. So in your case, require 'anystyle' will resolve to the file /usr/local/lib/ruby/gems/3.2.0/gems/anystyle-1.4.0/lib/anystyle.rb -- which looks fine. There is no anystyle-cli module to load the fact that gem which doesn't find any looks good as well.

Rather, the anystyle-cli includes the anystyle CLI tool. If you run which anystyle this should hopefully point to usr/local/lib/ruby/gems/3.2.0/bin/anystyle or something like that.

tylerandrewscott commented 1 year ago

Ah that makes sense, thank you for explaining it to me.