lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]

On Dec 19, 2007 10:32 AM, Luiz Henrique de Figueiredo
<> wrote:
> > And running this gives what you might expect: Parsing Error for file 'hello.lua'
> You should print the error message sent by Lua:
>         puts(lua_tostring(L,-1));
> This will tell you exactly what is wrong.

That helped, I got:
[WARNING] /home/shane/test2/lib/lua/test2.lua:1: module 'test' not found:
        no field package.preload['test']
        no file './test.lua'
        no file '/usr/local/share/lua/5.1/test.lua'
        no file '/usr/local/share/lua/5.1/test/init.lua'
        no file '/usr/local/lib/lua/5.1/test.lua'
        no file '/usr/local/lib/lua/5.1/test/init.lua'
        no file './'
        no file '/usr/local/lib/lua/5.1/'
        no file '/usr/local/lib/lua/5.1/':

Which is weird because I have 'test.lua' in the same folder as 'test2.lua'...
I moved the file 'test.lua' up one folder and everything works okay,
so perhaps my error is not the same as his. I simply modified my
existing project to test his code and my program uses a runtime data
directory that is not the same as the one the binary is located in,
which is what caused my issue, simply redirecting the 'test.lua' file
fixed the problem.

Rodrigo, make sure that your files are in the exact same folder, if
not, make sure they are in your path. To check your path, try Luiz's
suggestion "puts(lua_tostring(L,-1));" and let us know what that says.