lua 5.3.5 安装/初体验
安装
官网http://www.lua.org/start.html 参考 https://blog.csdn.net/qq_23954569/article/details/70879672
cd ~
sudo apt-get install -y libreadline7 libreadline-dev
wget http://www.lua.org/ftp/lua-5.3.5.tar.gz
tar zxf lua-5.3..tar.gz
cd lua-5.3.
sudo make linux test
sudo make install
因为放在了home,所以重装之后,只需要执行最后1句就OK了
包管理luarocks
才1M
cd ~
wget https://luarocks.org/releases/luarocks-3.0.4.tar.gz
tar zxpf luarocks-3.0..tar.gz
cd luarocks-3.0.
./configure; sudo make bootstrap
sudo luarocks install luasocket
安装luasql-postgres
安装时要求本地有postgres源码
Error: Could not find header file for PGSQL
No file libpq-fe.h in /usr/local/include
No file libpq-fe.h in /usr/include
No file libpq-fe.h in /include
You may have to install PGSQL in your system and/or pass PGSQL_DIR or PGSQL_INCDIR to the luarocks command.
Example: luarocks install luasql-postgres PGSQL_DIR=/usr/local
但是我的pg是在docker镜像里的, 所以怎么办呢?要么在host上装pg,但完全没必要.超极本上资源已经很紧了,只写代码,不做数据库.
在安装时指定PG路径, 注意不是PGSQL_DIR
sudo apt-get install libpq-dev
sudo luarocks install luasql-postgres PGSQL_INCDIR=/usr/include/postgresql PGSQL_LIBDIR=/usr/lib
连接db简单使用
luasql = require "luasql.postgres"
env = assert(luasql.postgres())
-- database user pwd host port
conn = assert(env:connect("postgres","postgres","example",'127.0.0.1')) -- version
cur = conn:execute("SELECT version();")
print(cur:fetch())
lua 5.3.5 安装/初体验的更多相关文章
- Nginx unit 源码安装初体验
Nginx unit 源码安装初体验 上次介绍了从yum的安装方法(https://www.cnblogs.com/wang-li/p/9684040.html),这次将介绍源码安装,目前最新版为1. ...
- visual studio for mac的安装初体验
微软2016 Connect 大会发布了visuo studio for mac的pre版本,由于工作原因,现在工作环境是mac,虽然开发现在是在用python,但一直关注着.net的发展,于是自己很 ...
- Node.js 安装 初体验(1)
1.安装nodejs http://nodejs.org/download/ 自动根据系统下载自己的版本node.js 2.环境变量 windows 安装,不需要配置环境变量 mac安装后,会提 ...
- Apache Flink教程----安装初体验
1.window 版本安装 https://flink.apache.org/downloads.html#apache-flink-164 D:\flink-1.6.2-bin-scala_2\fl ...
- mac上Docker安装&初体验
Docker是什么? Docker是一个虚拟环境容器,可以将你的开发环境.代码.配置文件等一并打包到这个容器中,并发布和应用到任意平台中. 官方文档:https://docs.docker.com H ...
- Haproxy 安装初体验
20180916 haproxy Haproxy简介 Haproxy是一款免费的.快速的和稳定的解决方案,提供HA和LB功能,同时对基于TCP的应用和HTTP的应用进行代理,对于流量很大的web站点来 ...
- laravel安装初体验
1.github下载laravel 2.通过composer安装相应的库 composer config repo.packagist composer https://packagist.phpco ...
- Centos7.3之K8S安装初体验
容器是发展趋势,所以是时候从虚拟机中脱离出来,投入到容器化的怀抱中了. 曾经试过安装k8s,都没有成功,各种乱七八糟的报错,于是一拖再拖,这次总算发现一个可以快速部署的工具,终于安装成功了. 这个k8 ...
- Python导出Excel为Lua/Json/Xml实例教程(二):xlrd初体验
Python导出Excel为Lua/Json/Xml实例教程(二):xlrd初体验 相关链接: Python导出Excel为Lua/Json/Xml实例教程(一):初识Python Python导出E ...
随机推荐
- 牛客随笔(c++)
1.关于指针的字节大小: 当为32位系统时大小为4字节,64位系统时大小为8字节: #include<iostream> using namespace std; int main() { ...
- java操作git简单实现
记录瞬间 import org.eclipse.jgit.api.Git; import org.eclipse.jgit.api.ListBranchCommand; import org.ecli ...
- Jenkins - ERROR: Exception when publishing, exception message [Failure] Build step 'Send build artifacts over SSH' changed build result to UNSTABLE
今天在处理Jenkins的时候出现了一些异常,看着控制台,编译都是通过的,只是没有部署上来,查看了控制台日志,如下: 刚开始还以为是权限通道什么的,后来才发现是执行脚本根本不让执行,以前也遇到过,都是 ...
- [macOS] git忽略所有的.DS_Store文件
最彻底的方法如下: vi ~/.gitignore_global 输入以下内容 # OS generated files # ###################### .DS_Store .DS_ ...
- Windows上IOCP Socket事件模型管理
1.IOCP 2.使用IOCP 1)创建完成端口CreateIoCompletionPort: 2)向完成端口添加管理句柄与管理用户数据: 3)异步发送一个管理的事件请求: 4)开启工作线程来处理I ...
- Vue学习5:条件渲染
上代码: <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF- ...
- PHP 不同类型之间的松散和严格比较
原始数据类型 在比较之前先简单介绍一下PHP的9种原始数据类型,包括 四种标量类型: boolean(布尔型) integer(整型) float(浮点型,也称作 double) string(字符串 ...
- SQL大数据查询优化
常写的SQL可能主要以实现查询出结果为主,但如果数据量一大,就会突出SQL查询语句优化的性能独特之处.一般的数据库设计都会建索引查询,这样较全盘扫描查询的确快了不少.下面总结下SQL查询语句的几个优化 ...
- mysql8操作命令(持续更新)
mysql服务管理 查看服务状态 systemctl status mysqld.service 启动服务 systemctl start mysqld.service 关闭服务 systemctl ...
- docker组件介绍
一.Docker Client and Daemon(docker egine docker 引擎) docker是一个客户端工具,作用是发送 用户的请求给 dockerd 安装路径: /usr/bi ...