171

When using the latest ZSH and RVM on Mac OS X 10.7.4 ZSH complains about this:

__rvm_cleanse_variables: function definition file not found

Tyler Brock
  • 29,626
  • 15
  • 79
  • 79

5 Answers5

496

Running the following solved the problem:

rm ~/.zcompdump*

Note: The * is incase there are multiple .zcompdump files.

Greg
  • 5,862
  • 1
  • 25
  • 52
Tyler Brock
  • 29,626
  • 15
  • 79
  • 79
  • 22
    ZSH uses `compinit` to initialize completion for the current session. To speed up the running of `compinit`, it can be made to produce a dumped configuration which will be read in on future invocations. This dumped file is `.zcompdump` in the same directory as the startup files (i.e. `$ZDOTDIR` or `$HOME`). – csgui Apr 09 '13 at 09:41
  • Boom goes the dynamite. – volker238 Jul 16 '14 at 20:07
  • searched for "whats 'zcompdump' for" while diagnosing the `__rvm_cleanse_variables` issue... two birds, one search. +1's to everyone. – max Mar 21 '15 at 18:54
  • just as a nitpick seems like you could remove the `-f` flag, doesn't seem necessary to bypass the remove file confirmation (if the user has it set in the first place) – pech0rin Dec 05 '16 at 21:38
109

Sometime there is also ~/.zcompdump-<COMPUTER NAME>-<VERSION> file, so use:

rm -f ~/.zcompdump*
heracek
  • 7,251
  • 3
  • 15
  • 10
7

To disable the .zcompdump* file(s), you could look in your .zshrc (or /etc/zsh/* files) for compinit and add the -D flag.

This might be better than creating the files and deleting them at every login.

(source: http://www.csse.uwa.edu.au/programming/linux/zsh-doc/zsh_23.html)

nomad
  • 116
  • 1
  • 2
  • But probably .zcompdump files have advantages and by deleting them it has side effects. – Timo Aug 11 '22 at 10:04
4

My problem persisted even after the compinit -D and rm -f ~/.zcompdump*. I found this github issue and checked my .zplug directory and sure enough found some non-hidden zcompdump files (no preceding '.'). Deleted those and I was good to go. If you're using a zsh plugin manager like zgen or zplug, check their directories.

Andrew Prentice
  • 275
  • 2
  • 7
  • boy u saved day. for me along with `~/.zcomdump*`, need to remove `~/.antigen/.zcomdump*` too – userx Oct 13 '17 at 07:19
1

Add rm -f ~/.zcompdump{,.zwc} to .zlogin to automate it

hanetzer
  • 690
  • 6
  • 18