ThePrimeagen / init.lua

3.09k stars 573 forks source link

Missing Prerequisite for C compiler #118

Open cverbiest opened 1 month ago

cverbiest commented 1 month ago

After watching your great video I decided it would be easier to start with your config and modify it rather that starting from scratch.

After cloning the repo I get

Failed to run `config` for nvim-treesitter
....local/.config/nvim/lua/theprimeagen/lazy/treesitter.lua:44: attempt to call field 'register' (a nil value)
# stacktrace:
  - nvim/lua/theprimeagen/lazy/treesitter.lua:44 _in_ **config**
  - /cellular-automaton.nvim/plugin/cellular-automaton.lua:6
  - nvim/lua/theprimeagen/lazy_init.lua:14
  - nvim/lua/theprimeagen/init.lua:3
Press ENTER or type command to continue
  - nvim/init.lua:1
Press ENTER or type command to continue
Failed to source `~/.local/share/nvim/lazy/cellular-automaton.nvim/plugin/cellular-automaton.lua`
...local/share/nvim/lazy/lazy.nvim/lua/lazy/core/loader.lua:485: Vim(source):No C compiler found! "cc", "gcc", "clang", "cl", "zig" are not executable.
# stacktrace:
  - nvim/lua/theprimeagen/lazy_init.lua:14
  - nvim/lua/theprimeagen/init.lua:3

I think C should be added as a prerequiste.

After installing C, using https://developers.redhat.com/articles/2023/11/10/install-gcc-and-build-hello-world-application-rhel-8#,
I get errors on harpoon so there is probably another prerequiste.

Failed to run `config` for nvim-treesitter
....local/.config/nvim/lua/theprimeagen/lazy/treesitter.lua:44: attempt to call field 'register' (a nil value)
# stacktrace:
  - .config/nvim/lua/theprimeagen/lazy/treesitter.lua:44 _in_ **config**
  - .config/nvim/lua/theprimeagen/lazy_init.lua:14
  - .config/nvim/lua/theprimeagen/init.lua:3
Press ENTER or type command to continue
  - .config/nvim/init.lua:1
Press ENTER or type command to continue
Failed to run `config` for harpoon
...~/.config/nvim/lua/theprimeagen/lazy/local.lua:7: module 'harpoon' not found:
^Ino field package.preload['harpoon']
cache_loader: module harpoon not found
cache_loader_lib: module harpoon not found
^Ino file './harpoon.lua'
^Ino file '/usr/share/luajit-2.1.0-beta3/harpoon.lua'
^Ino file '/usr/local/share/lua/5.1/harpoon.lua'
^Ino file '/usr/local/share/lua/5.1/harpoon/init.lua'
^Ino file '/usr/share/lua/5.1/harpoon.lua'
^Ino file '/usr/share/lua/5.1/harpoon/init.lua'
^Ino file './harpoon.so'
^Ino file '/usr/local/lib/lua/5.1/harpoon.so'
^Ino file '/usr/lib64/lua/5.1/harpoon.so'
^Ino file '/usr/local/lib/lua/5.1/loadall.so'
# stacktrace:
  - .config/nvim/lua/theprimeagen/lazy/local.lua:7 _in_ **config**
  - .config/nvim/lua/theprimeagen/lazy_init.lua:14
  - .config/nvim/lua/theprimeagen/init.lua:3
venom-10 commented 1 month ago

Yeah, I think we should have to install gcc.

venom-10 commented 1 month ago

Did you find any solution for second issue?

cverbiest commented 1 month ago

cloned harpoon into ~/personal but I still had issues, disabled harpoon for now by removing code from lua/theprimeagen/lazy/local.lua.

cverbiest commented 1 month ago

checkout out harpoon2 branch looks fine now.

arunbhardwaj commented 6 days ago

If you're copying his files, his treesitter config registers a Go HTML templating language, which you don't need unless you're trying to use that. Also, regarding harpoon, he pulls his harpoon plugin from his local files. You have to pull it from his repo. Your plugin file should look something like:

return {
    "ThePrimeagen/harpoon", -- his is something like ~/personal/harpoon
    branch = "harpoon2",
    dependencies = { "nvim-lua/plenary.nvim" },
    config = function()
        local harpoon = require("harpoon")
        harpoon:setup()
        --[[
        <set your preferred keybinds for harpoon:list():add(), select(), toggle_quick_menu(), etc.>
        I recommend setting your own keybinds here. Primeagen uses dvorak layout.
        --]]
        end
}