安装

官网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 安装/初体验的更多相关文章

  1. Nginx unit 源码安装初体验

    Nginx unit 源码安装初体验 上次介绍了从yum的安装方法(https://www.cnblogs.com/wang-li/p/9684040.html),这次将介绍源码安装,目前最新版为1. ...

  2. visual studio for mac的安装初体验

    微软2016 Connect 大会发布了visuo studio for mac的pre版本,由于工作原因,现在工作环境是mac,虽然开发现在是在用python,但一直关注着.net的发展,于是自己很 ...

  3. Node.js 安装 初体验(1)

    1.安装nodejs http://nodejs.org/download/  自动根据系统下载自己的版本node.js 2.环境变量 windows 安装,不需要配置环境变量   mac安装后,会提 ...

  4. Apache Flink教程----安装初体验

    1.window 版本安装 https://flink.apache.org/downloads.html#apache-flink-164 D:\flink-1.6.2-bin-scala_2\fl ...

  5. mac上Docker安装&初体验

    Docker是什么? Docker是一个虚拟环境容器,可以将你的开发环境.代码.配置文件等一并打包到这个容器中,并发布和应用到任意平台中. 官方文档:https://docs.docker.com H ...

  6. Haproxy 安装初体验

    20180916 haproxy Haproxy简介 Haproxy是一款免费的.快速的和稳定的解决方案,提供HA和LB功能,同时对基于TCP的应用和HTTP的应用进行代理,对于流量很大的web站点来 ...

  7. laravel安装初体验

    1.github下载laravel 2.通过composer安装相应的库 composer config repo.packagist composer https://packagist.phpco ...

  8. Centos7.3之K8S安装初体验

    容器是发展趋势,所以是时候从虚拟机中脱离出来,投入到容器化的怀抱中了. 曾经试过安装k8s,都没有成功,各种乱七八糟的报错,于是一拖再拖,这次总算发现一个可以快速部署的工具,终于安装成功了. 这个k8 ...

  9. Python导出Excel为Lua/Json/Xml实例教程(二):xlrd初体验

    Python导出Excel为Lua/Json/Xml实例教程(二):xlrd初体验 相关链接: Python导出Excel为Lua/Json/Xml实例教程(一):初识Python Python导出E ...

随机推荐

  1. 详解iBaits中SqlMapClientTemplate的使用

    Apache iBatis(现已迁至Google Code下发展,更名为MyBatis)是当前IT项目中使用很广泛的一个半自动ORM框架,区别于Hibernate之类的全自动框架,iBatis对数据库 ...

  2. 记录Django学习1

    一.Django 1.首先安装好django模块 pip3 install django 2.然后配置好相应的环境变量 C:\Python35\Scripts 3. 创建Django工程,首先可以使用 ...

  3. Linq To Object 函数介绍

    static void Main(string[] args) { #region Aggregate 把集合中的元素按照表达式依次执行 { IEnumerable<int> list = ...

  4. 前端JS插件整理

    1.JQuery.js JavaScript 库,简化JS. 官网地址:https://jquery.com/ 菜鸟教程:http://www.runoob.com/jquery/jquery-tut ...

  5. PHP图像处理(GD库)

    一.图像处理概述 1.开启GD2图像扩展库 ①PHP不仅限于只产生HTML的输出,还可以创建与操作多种不同格式的图像文件.PHP提供了一些内置的图像处理函数,也可以使用GD函数库创建新图像或处理已有的 ...

  6. 论文速读(Chuhui Xue——【arxiv2019】MSR_Multi-Scale Shape Regression for Scene Text Detection)

    Chuhui Xue--[arxiv2019]MSR_Multi-Scale Shape Regression for Scene Text Detection 论文 Chuhui Xue--[arx ...

  7. Halcon 和 C# 联合编程 - 图像变量的相互转换(HObject、HImage、Bitmap)

    /// <summary> /// 灰度图像 HObject -> Bitmap /// </summary> public static Bitmap HObject2 ...

  8. 二分法bug修复

    public class Main { public static void main(String[] args) { int[] arr = {1,2,3,4,5,6,7,8,9,10}; int ...

  9. Linux开局配置注意事项

    1.修改ssh配置文件远程端口号,防止攻击 sed    -ri   's/“#Port 22”/“Port 10086”/g‘    /etc/ssh/sshd_config 2.修改ssh配置文件 ...

  10. pthread_cond_wait虚假唤醒

    pthread_cond_wait中的while()不仅仅在等待条件变量前检查条件cond_is_false是否成立,实际上在等待条件变量后也检查条件cond_is_false是否成立.在多线程等待的 ...