安装lua和luarocks

回到:


安装lua 5.3.4

1
2
3
4
5
6
7
8
9
10
11
12
13
14
yum install libtermcap-devel ncurses-devel libevent-devel readline-devel -y

curl -R -O http://www.lua.org/ftp/lua-5.3.4.tar.gz
tar xf lua-5.3.4.tar.gz
cd lua-5.3.4
make linux
make install INSTALL_TOP=/usr/local/lua53

# 如果已经装了lua51,先备份
mv /usr/bin/{lua,lua51}
mv /usr/bin/{luac,luac51}

ln -sf /usr/local/lua53/bin/lua /usr/bin/lua
ln -sf /usr/local/lua53/bin/luac /usr/bin/luac

安装luajit

1
2
3
4
5
6
7
wget https://github.com/LuaJIT/LuaJIT/archive/v2.0.5.tar.gz
tar xf v2.0.5.tar.gz
cd LuaJIT-2.0.5
make PREFIX=/usr/local/luajit2
make install PREFIX=/usr/local/luajit2

ln -sf /usr/local/luajit2/bin/luajit /usr/bin/luajit

安装luarocks

1
2
3
4
5
6
7
8
wget https://luarocks.org/releases/luarocks-3.3.1.tar.gz
tar xf luarocks-3.3.1.tar.gz
cd luarocks-3.3.1
./configure --prefix=/usr/local/luarocks
make && make install

ln -sf /usr/local/{luarocks,usr}/bin/luarocks
ln -sf /usr/local/{luarocks,usr}/bin/luarocks-admin
文章作者: 骏马金龙
文章链接: http://www.junmajinlong.com/lua/install_lua_luarocks/
版权声明: 本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来自 骏马金龙
打赏我