<p>Here is the <a href="https://luarocks.org/" target="_blank" rel="external noopener noreferrer">official website of LuaRocks</a>. LuaRocks is the package manager for Lua moduels, which means that we can use it to install or uninstall some specific Lua libraries like LuaMySQL and LuaMongoDB.</p>
Below is the tutorial to install LuaRocks.
Here we use Centos 7. We will install LuaRocks through command lines as follows (Here is official tutorial):
Now execute this command:
If everythings goes well, we can similar output as below:
Now we will try to install LuaSocket through LuaRocks. Note that we may need to use sudo command but luarocks may not be identified by sudo. In that case, we can use root user to execute luarocks command:
To check that luasocket whether is installed successfully or not, we can enter lua shell and type:
The output returned by command should be similar as follows:
> require "socket"