r/lua • u/magicmathman1_ • Apr 05 '25
Luarocks Error: Attempted to index a nil value (field 'LUA_BINDIR')
Whenever I try to do anything with luarocks (ANYTHING) I get a litle pop up with this error:
[string "src/luarocks/core/cfg.lua"]:824: attempt to index a nil value (field 'LUA BINDIR')
stack traceback:
[string "src/luarocks/core/cfg.lua"]:824: in function 'luarocks.core.cfg.init
[string "src/luarocks/loader.lua"]:21: in main chunk [C]: in function 'require'
[string "luarocks"]:5: in main chunk [C]: in ?
I have LuaJIT installed as well as LOVE, which I am trying to get luarocks to work with. I have my paths correctly added, and everything SHOULD work, but it doesn't. I cant do any cmd commands with luarocks because everything returns the same error. I can't find anything online.
(Edit: When I say I was trying to use LOVE with luarocks, I'm not trying to install LOVE, I'm trying to install packages so I can used them WITH love, just FYI.)
1
u/SkyyySi Apr 05 '25
What code / commands are you running which trigger this? There isn't much anyone can do to help you if they don't know exactly what you were doing.
1
u/[deleted] Apr 05 '25
Love has lua within it but not the lua interpreter itself, just try running a script that only has print"hello" with love hello.lua it will launch love and fail, given that it doesn't interpret scripts it is not an interpreter
It should use luajit, but it must be in your PATH and must be called lua you can also use LUA_BINDIR=/where/your/lua/is/
1
u/Difficult-Value-3145 Apr 05 '25
Lua5. 1 install that and see what a happens