lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Howdy,
I got the third edition of Programming in Lua but find that the instructions on both the website and book are fairly vague on installing and using Lua. I clicked on what I thought was a link regarding information about Lua 5.3.3 but got the download instead. I was able to follow the terminal instructions that were included in the lua directory.  So that was good, but I feel that it was just pure luck that I got the download. 
I got the source code and installed it using the terminal ‘make’ command in my home directory. 
However, I was not able to get Lua to actually run. Typing lua on the command line returned a command not found error message. 
So, in terminal, I went to the lua/src directory and was able to call up lua using the command   ./lua
which returned this:

Lua 5.3.3  Copyright (C) 1994-2016 Lua.org, PUC-Rio

and was able to play a bit with lua.

Also I found that if I entered     /User path/lua-5.3.3/src/lua     from the command line I would also get the above results. So I created an alias,

alias lua="/Users/trav/lua-5.3.3/src/lua” 

which now lets me simply type lua to call it up: i.e. lua hello.lua


 and even get the lua hello world file to perform as expected.
 
This seems to be a bit complex, so I am asking if this is what I am supposed to do on my iMac? 


I did try searching for lua binaries in google, but the search showed things for installing lua on very outdated versions of OS X, although they did seem to indicate that installing via that method would indeed let one simply use the word lua on the command line immediately after installing.

Now I confess that I could have very easily missed something at lua.org, there is a huge amount of information there. 

Perhaps there is someplace in lua.org that you could refer me to in regard to using my Mac with lua, or perhaps what I have done is an acceptable or only way to get lua to work as I installed it.

Thank you for your help and time,
trav