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

Linux PATH for lua rocks #342

Closed
bwanaaa opened this issue Mar 30, 2015 · 1 comment
Closed

Linux PATH for lua rocks #342

bwanaaa opened this issue Mar 30, 2015 · 1 comment

Comments

@bwanaaa
Copy link

@bwanaaa bwanaaa commented Mar 30, 2015

this page:

https://github.com/keplerproject/luarocks/wiki/File-locations

does not match what i get from

luarocks path

which is:

export LUA_PATH='/home/stefan/.luarocks/share/lua/5.3/?.lua;/home/stefan/.luarocks/share/lua/5.3/?/init.lua;/usr/local/share/lua/5.3/?.lua;/usr/local/share/lua/5.3/?/init.lua;/usr/local/lib/lua/5.3/?.lua;/usr/local/lib/lua/5.3/?/init.lua;./?.lua;./?/init.lua'
export LUA_CPATH='/home/stefan/.luarocks/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/?.so;/usr/local/lib/lua/5.3/loadall.so;./?.so'

and the output of

echo $PATH

is

/opt/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games

I installed the 'inspect' rock with

sudo luarocks install inspect

and then I wrote the following sample lua to test it

local inspect = require "inspect"
assert (inspect(1) == "1")
assert(inspect("Hello") == '"Hello"')

but got the following errors:

Program starting as '"/opt/zbstudio/bin/linux/x64/lua" -e "io.stdout:setvbuf('no')" "/opt/zbstudio/myprograms/DemoInspect.lua"'.
Program 'lua' started in '/opt/zbstudio/myprograms' (pid: 5190).
/opt/zbstudio/bin/linux/x64/lua: /opt/zbstudio/myprograms/DemoInspect.lua:1: module 'inspect' not found:
    no field package.preload['inspect']
no file './inspect.lua'
no file '/usr/local/share/luajit-2.0.2/inspect.lua'
no file '/usr/local/share/lua/5.1/inspect.lua'
no file '/usr/local/share/lua/5.1/inspect/init.lua'
no file './inspect.lua'
no file './inspect/init.lua'
no file './lua/inspect.lua'
no file './lua/inspect/init.lua'
no file '/opt/zbstudio/lualibs/inspect/inspect.lua'
no file '/opt/zbstudio/lualibs/inspect.lua'
no file '/opt/zbstudio/lualibs/inspect/inspect/init.lua'
no file '/opt/zbstudio/lualibs/inspect/init.lua'
no file './inspect.so'
no file '/usr/local/lib/lua/5.1/inspect.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file '/opt/zbstudio/bin/linux/x64/libinspect.so'
no file '/opt/zbstudio/bin/linux/x64/clibs/inspect.so'
stack traceback:
[C]: in function 'require'
/opt/zbstudio/myprograms/DemoInspect.lua:1: in main chunk
[C]: at 0x004054e8

What should I add to my PATH?
If my PATH is something like

/usr/

does that mean that all files and folders within that directory are recursively included? or just the files within /usr/? and is /usr/ the same as /usr ?

@hishamhm
Copy link
Member

@hishamhm hishamhm commented Mar 30, 2015

this page:
https://github.com/keplerproject/luarocks/wiki/File-locations
does not match what i get from
luarocks path

It does match. luarocks path is showing configured paths for /usr/local just like the wiki page says.

but got the following errors:

Looking at the lookup paths, looks like your LuaRocks installation is configured for Lua 5.3, and your ZeroBrane Studio is configured for Lua 5.1

What should I add to my PATH?

Running eval \luarocks path --bin`` will set all necessary paths for your environment.

does that mean that all files and folders within that directory are recursively included?

Take a look at your OS and Lua documentation for details on how these environment variables work.

Also, please use the LuaRocks mailing list for support questions, and not the bug tracker.

@hishamhm hishamhm closed this Mar 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants