-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
compdef: unknown command or service: rails #144
Comments
OMZ completions get tricky because there's a chicken-and-egg issue where your fpath needs to be populated before running compinit so usually you want to run that late in your plugin list, but some OMZ plugins assume compinit was already run and call functions that don't exist yet like compdef. antidote, like antibody before it, doesn't do any special handling for OMZ. You can still use OMZ completion plugins, just use the See discussion here: #163 TLDR: # .zsh_plugins.txt
# Standard plugins
djui/alias-tips
# Oh My Zsh plugins (lib required first)
ohmyzsh/ohmyzsh path:lib
ohmyzsh/ohmyzsh path:plugins/git
ohmyzsh/ohmyzsh path:plugins/npm
ohmyzsh/ohmyzsh path:plugins/yarn
ohmyzsh/ohmyzsh path:plugins/brew
ohmyzsh/ohmyzsh path:plugins/ruby
ohmyzsh/ohmyzsh path:plugins/rails kind:fpath # NOTE: Required to fix "command not found: compdef" errors
ohmyzsh/ohmyzsh path:plugins/macos
ohmyzsh/ohmyzsh path:plugins/zoxide
ohmyzsh/ohmyzsh path:plugins/thefuck
ohmyzsh/ohmyzsh path:plugins/bundler
ohmyzsh/ohmyzsh path:plugins/composer
ohmyzsh/ohmyzsh path:plugins/1password
# Initialize Zsh completions (must be LAST because fpath needed populated first)
zshzoo/completion
# now load plugins that expected compinit
ohmyzsh/ohmyzsh path:plugins/rails |
Thanks for the reply, but with:
I get: |
Good catch Alec. I added a commit with a working example for you here: https://github.com/getantidote/zdotdir/tree/demo-antidote-issue-144 |
Thanks, but unless I'm missing something that still doesn't work.
When I launch a terminal I get:
|
|
Seems to be: I only add a couple things to my In fact if I comment out everything from my # Source Antidote
source "$HOMEBREW_PREFIX/opt/antidote/share/antidote/antidote.zsh"
# Set variables required by Oh My Zsh plugins
ZSH=$(antidote path ohmyzsh/ohmyzsh)
export ZSH
export ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/oh-my-zsh"
[[ -d $ZSH_CACHE_DIR ]] || mkdir -p "$ZSH_CACHE_DIR"
# Load Zsh plugins with Antidote
antidote load I would put this down to some quirk of the environment on this machine. But I recently installed my dotfiles from scratch on a new work machine, same issue. I found ohmyzsh/ohmyzsh/issues/2337 but solutions in there didn't work for me. |
Somewhere you need to initialize homebrew so its binaries are added to your path. Whether that's in a plugin, or manually, you need to run # Setup homebrew and your $PATH
eval $(/opt/homebrew/bin/brew shellenv)
# Source Antidote
source "$HOMEBREW_PREFIX/opt/antidote/share/antidote/antidote.zsh"
# Set variables required by Oh My Zsh plugins
ZSH=$(antidote path ohmyzsh/ohmyzsh)
export ZSH
export ZSH_CACHE_DIR="${XDG_CACHE_HOME:-$HOME/.cache}/oh-my-zsh"
[[ -d $ZSH_CACHE_DIR ]] || mkdir -p "$ZSH_CACHE_DIR"
# Load Zsh plugins with Antidote
antidote load |
Sorry I should have said, I do have the Homebrew path line in Thinking that maybe it's due to the load order of Thankfully I'm not working with Rails right now so I don't mind having this plugin excluded. However it does seem this plugin works fine when only using OMZ, but not when loading it with Antidote. Regarding your reproduction repo there seems to be files like Very odd this is happening on fresh machine too, I wonder how many other Antidote users are successfully using the |
As of June 2024, the recommended way of handling OMZ is now to include the new getantidote/use-omz plugin at the TOP of your |
I'm trying to switch from Oh My Zsh to Antidote. Here's my setup:
.zshrc
.zsh_plugins.txt
After digging to discover I need special OMZ vars defined in my
.zshrc
file and a special completion plugin to fix errors, I'm down to just one error when my terminal loads:Any idea how I can fix this? Ruby is installed via rtx and
rails
is installed also as it's one of my default gems.The text was updated successfully, but these errors were encountered: