Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LuaJIT require module error

Tags:

lua

luajit

require "utils.lua"
stdin:1: module 'utils.lua' not found:
        no field package.preload['utils.lua']
        no file 'D:\blizzard\Projects\Lua'
        no file '.\utils\lua.dll'
        no file 'D:\blizzard\Projects\Lua\utils\lua.dll'
        no file 'D:\blizzard\Projects\Lua\loadall.dll'
        no file '.\utils.dll'
        no file 'D:\blizzard\Projects\Lua\utils.dll'
        no file 'D:\blizzard\Projects\Lua\loadall.dll'

Why LuaJIT searches for .dll instead of .lua and how to fix this behavior?

like image 349
DSblizzard Avatar asked Jul 20 '11 10:07

DSblizzard


1 Answers

You should require utils (ditch the .lua) , and utils.lua should be on your package.path variable, or passed as the LUA_PATH environment variable.

More info in the Lua Reference Manual about package.loaders, require() and package.path

like image 100
jpjacobs Avatar answered Oct 18 '22 20:10

jpjacobs