Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't run the test script #1

Open
soichih opened this issue Jun 16, 2015 · 0 comments
Open

can't run the test script #1

soichih opened this issue Jun 16, 2015 · 0 comments

Comments

@soichih
Copy link

soichih commented Jun 16, 2015

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant