Skip to content

can't run the test script #1

@soichih

Description

@soichih

I am absolutely new on lua, and so far I am having problem getting the test script to run.

I've installed lua and luarocks (I think..) and I did

sudo luarocks install --server=http://rocks.moonscript.org luajwt

which installed some files under /usr/local/share/lua

 $ ls
cjson  json2lua.lua  lua2json.lua  luajwt.lua  luarocks

I also see

/usr/local/lib/lua/5.1 $ ls
base64.so  cjson.so  crypto.so

Now.. when I run the test script it fails on the first line.

$ lua test.lua
lua: test.lua:1: module 'luajwt' not found:
        no field package.preload['luajwt']
        no file './luajwt.lua'
        no file '/usr/share/lua/5.1/luajwt.lua'
        no file '/usr/share/lua/5.1/luajwt/init.lua'
        no file '/usr/lib64/lua/5.1/luajwt.lua'
        no file '/usr/lib64/lua/5.1/luajwt/init.lua'
        no file './luajwt.so'
        no file '/usr/lib64/lua/5.1/luajwt.so'
        no file '/usr/lib64/lua/5.1/loadall.so'
stack traceback:
        [C]: in function 'require'
        test.lua:1: in main chunk
        [C]: ?

So I added the path on LUA_PATH

export LUA_PATH=/usr/local/share/lua/5.1/luajwt.lua
lua test.lua

which now gives..

lua: /usr/local/share/lua/5.1/luajwt.lua:1: loop or previous error loading module 'cjson'
stack traceback:
        [C]: in function 'require'
        /usr/local/share/lua/5.1/luajwt.lua:1: in main chunk
        [C]: in function 'require'
        /usr/local/share/lua/5.1/luajwt.lua:1: in main chunk
        [C]: in function 'require'
        test.lua:1: in main chunk
        [C]: ?

Do I need to give all of the dependencies in the PATH individually, or is there a better way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions