Well I've recently decided to start learning lua and I have some problems executing code in Sublime Text 3 although everything works fine in command line
The error output shows you, in order:
PATH
environment variable, so that if there was a problem finding the command to execute you can see where it looked.If you look at the third item there, the command that was executed, it's:
[cmd: ['lua', '']]
This means that it tried to execute the command 'lua' with an empty second argument. The reason for that is that you didn't save your file before you tried to run it; thus is has no associated file name to give to the command.
Saving the file first will solve the problem. The Tools > Save all on build
option (when checked) will make sure that all unsaved changes are persisted to disk before the program runs, but this only works for files that have already been saved at least once.