Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Lua on windows

I'm new to Lua, and need to know how to install it on Windows?

I've tried and am unable to run the sample. When I try to compile it 100% success is shown, but when I click the run button it shows this error:

Can't find moai executable in any of the folders in PATH or MOAI_BIN:
C:\Program Files\moai, D:\Program Files\moai, C:\Program Files (x86)\moai, D:\Program Files (x86)\moai, C:\WINDOWS\system32, C:\WINDOWS, C:\WINDOWS\System32\Wbem, C:\moai-sdk\bin\win32\moai.exe, C:\moai-sdk/bin 

If anyone can help me on how to install Lua, thanks.

like image 728
sai Avatar asked Nov 02 '22 21:11

sai


1 Answers

Lua does not have a certified IDE or compiler to come with it. You usually run lua code from a lua command line / lua file which will handle the tasks you are attempting to create.

Downloading

Lua has a website where you can download their tools which will allow you to write and execute lua code: https://www.lua.org/download.html

Using lua console

After you download the file, put it in a file location anywhere on your computer, in order execute lua code; the first method is to open the lua console and simply type out your command: https://prnt.sc/ibw97h

Another method you can use, is make a .txt or .lua file, write your code in that, then you can drag and drop the file onto the lua console to execute it: https://prnt.sc/ibwa2f

Installing lua system wide

Add lua in the environment variables by adding the path from where it's installed. After doing this you can open PowerShell and enter lua53.exe to open lua.

Additional details

Although these is what lua directly offers, there are other third party alternatives of compiling and executing lua code. Examples of these can be found if you search for them.

like image 52
Hex Avatar answered Nov 09 '22 11:11

Hex