1

When I trying to launch some .rs files (rust files) I catch error in neovim:

Error detected while processing BufReadPost Autocommands for "*":
Error executing lua callback: /usr/share/nvim/runtime/filetype.lua:22: Error executing lua: /usr/share/nvim/runtime/filetype.lua:23: Vim(append):Error
 executing lua callback: Vim:E475: Invalid value for argument cmd: 'cargo' is not executable

My lsp.lua config file is empty, because all servers I installed from Mason, I also reinstall neovim, reinstalled runtime directory etc what was described in internet but nothing changed(((( Small thing about this all, this error was not there until i reinstalled rust to rustup from other rust version (I forgot the name), because I think my autocompletion didn't work because rust version or something else related with my rust blocked this

1 Answers1

3

Well, neovim printed your problem:

Vim:E475: Invalid value for argument cmd: 'cargo' is not executable

It seemst that you haven't installed cargo which you'll get if you install rust. I'd highly recommend to install rustup with the package manager of your linux-distribution and execute:

rustup default stable

afterwards. This should install your relevant tools to develop with rust (including your missing program cargo).

TornaxO7
  • 1,150
  • 9
  • 24
  • do I need to create a PATH variable .cargo/bin when I install rustup? (I use fedora) – miraculous_guru Jan 31 '23 at 02:39
  • 1
    No you don't, just install rustup with `sudo dnf install rustup`, re-open your terminal, by closing your current terminal and open a new terminal-window, and execute `rustup default stable` and you should be fine. – TornaxO7 Jan 31 '23 at 12:19