bug: No times executable found for ruby 3.3.0
dorianmariecom opened this issue · 4 comments
Describe the Bug
I have a gem, dorian-times
which has an executable times
- rubygems: https://rubygems.org/gems/dorian-times
- source code: https://github.com/dorianmariecom/dorian-times
I can do gem install dorian-times
But when I do times
I get:
> times
No times executable found for ruby 3.3.0
Other projects like dorian-each work just fine and use the same setup
Steps to Reproduce
asdf install ruby 3.3.0
asdf local ruby 3.3.0
orasdf global ruby 3.3.0
gem install dorian-times
times
Expected Behaviour
Shows the help message
Actual Behaviour
Shows an error message
Environment
OS:
Darwin Dorians-MacBook-Air.local 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:19:22 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8112 arm64
SHELL:
fish, version 3.7.0
BASH VERSION:
3.2.57(1)-release
ASDF VERSION:
v0.14.0-ccdd47d
ASDF INTERNAL VARIABLES:
ASDF_DEFAULT_TOOL_VERSIONS_FILENAME=.tool-versions
ASDF_DATA_DIR=/Users/dorianmariefr/.asdf
ASDF_DIR=/Users/dorianmariefr/.asdf
ASDF_CONFIG_FILE=/Users/dorianmariefr/.asdfrc
ASDF INSTALLED PLUGINS:
nodejs https://github.com/asdf-vm/asdf-nodejs.git master c5b7c40
ruby https://github.com/asdf-vm/asdf-ruby.git master 7a22142
rust https://github.com/code-lever/asdf-rust.git master 95acf4f
yarn https://github.com/twuni/asdf-yarn.git main 376c540
asdf plugins affected (if relevant)
ruby
I came across the same issue myself. It seems that the shim path is not being added in the right place in your $PATH
variable, i.e. right at the beginning.
I updated my /opt/homebrew/opt/asdf/libexec/asdf.fish
script on lines 19-21 to:
if not test (contains -i $_asdf_shims $PATH) -eq 1
set -gx --prepend PATH $_asdf_shims
end
I had more issues with PATH being in dir1:dir2
format during the running of /opt/homebrew/opt/asdf/libexec/asdf.fish
instead of the fish format of dir1 dir2
.
I updated /opt/homebrew/opt/asdf/libexec/asdf.fish
to simply just prepend the shim path without doing any checks. It's hacky, but it works for now.
set -gx --prepend PATH $_asdf_shims $PATH
instead of
if not test (contains -i $_asdf_shims $PATH) -eq 1
set -gx --prepend PATH $_asdf_shims
end
Apologies for the delay.
There are multiple things happening in this thread.
For the OP:
Steps to Reproduce
- asdf install ruby 3.3.0
- asdf local ruby 3.3.0 or asdf global ruby 3.3.0
- gem install dorian-times
- times
There is a step missed here. Between step 3 and 4 you need to run asdf reshim ruby
. Any tool installed with a managed tool will require a reshim to be run. See the documentation - https://asdf-vm.com/manage/core.html#reshim
There are some efforts to automate this, but that is plugin-specific and generally discouraged as the time taken to perform the reshim is proportional to the number to gems
or npm
packages etc installed.
As for the other issues in this thread, it seems we have some issues with Fish that need to be addressed. Homebrew issues are noted in other Issues.