源码安装luarocks

下载安装

[root@test ~]# wget http://luarocks.github.io/luarocks/releases/luarocks-2.4.2.tar.gz
[root@test ~]# cd luarocks-2.4.2
[root@test ~]# ./configure --prefix=/usr/local/luarocks --with-lua=/usr/local/lua/
[root@test ~]# make build
[root@test ~]# make install

增加luarocks的bin目录到系统里并生效

[root@test ~]# echo 'export PATH=/usr/local/luarocks/bin/:${PATH}' >> /etc/profile
[root@test ~]# source /etc/profile

设置lua库的环境变量并生效

[root@test ~]# echo "export LUA_PATH='/usr/local/lua/lib/lua/5.3/?.lua;/usr/local/luarocks/lib/lua/5.3/?.lua;/usr/local/luarocks/share/lua/5.3/?.lua;?.lua;;'"
[root@test ~]# echo "export LUA_CPATH='/usr/local/lua/lib/lua/5.3/?.so;/usr/local/luarocks/lib/lua/5.3/?.so;/usr/local/luarocks/share/lua/5.3/?.so;?.so;;'"
[root@test ~]# source /etc/profile

你可能感兴趣的:(lua)