lapis 框架安装试用
备注:
此次安装使用的是openresty 的openresty-1.11.2.1(openresty-1.11.2.1.tar.gz,最新版本存在cjson 包的问题 )
同时对于luarocks 使用源码安装(使用yum 会有包的问题,解决起来少为费事点,实际上通过配置环境变量
也可以解决,就是费事,同时容易遗漏)
1. openresty 安装(需要的依赖按照提示安装即可)
wget https://openresty.org/download/openresty-1.11.2.1.tar.gz
tar zxvf openresty-1.11.2.1.tar.gz
cd openresty-1.11.2.1
./configure
gmake && gmake install
2. luarocks(源码)
wget https://luarocks.github.io/luarocks/releases/luarocks-2.4.3.tar.gz
tar -xzvf luarocks-2.4.3.tar.gz
cd luarocks-2.4.3
./configure --prefix=/usr/local/openresty/luajit \
--with-lua=/usr/local/openresty/luajit/ \
--lua-suffix=jit \
--with-lua-include=/usr/local/openresty/luajit/include/luajit-2.1
make
sudo make install
3. lapis&&moonscript安装(lua 编译)
/usr/local/openresty/luajit/luarocks install moonscript
/usr/local/openresty/luajit/luarocks install lapis
4. 工具环境变量配置
ln -s /usr/local/openresty/luajit/bin/luarocks /usr/bin/luarocks
ln -s /usr/local/openresty/luajit/bin/lapis /usr/bin/lapis
ln -s /usr/local/openresty/luajit/bin/moonc /usr/bin/moonc
ln -s /usr/local/openresty/luajit/bin/moon /usr/bin/moon
5. lapis 使用
// 目前站点放在 /usr/local/openresty/site/lualib 可以自定义
// create projeect
lapis new --lua (默认为moonscript 最好使用moonc 进行实时编译)
lapis server
6. 效果


7. 参考资料
http://moonscript.org/
http://leafo.net/lapis/reference/lua_getting_started.html
https://openresty.org/en/using-luarocks.html
https://openresty.org/en/download.html#source-code-releases
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)