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 ...
随机推荐
- 使用 js,自己写一个简单的滚动条
当我们给元素加上 overflow: auto; 的时候,就会出现滚动条,然而浏览的不同,滚动条的样式大不一样,有些甚至非常丑. 于是就想着自己写一个滚动条,大概需要弄清楚一下这几个点: 1.滚动条 ...
- html-webpack-plugin插件使用时参数配置
ERROR in multi main Module not found: Error: Cannot resolve 'file' or 'directory' ./public/pages/ind ...
- webpack基础小结。
想写写webpack的学习体验的小结,加深自己的理解和使用技能,顺便过一下文档(4.0的功能感觉还是满好玩的). 本文主简写描述webpack中对各种文件的简单处理 基本知识点 处理js 加载css文 ...
- 《linux就该这么学》第十二节课:第10章,Apache网站服务
第十章 10.1.网站服务程序 (让用户能够通过网站访问服务器上的资源) 目前提供的网站服务有IIS,Nginx,Apache等,IIS是windows中默认的web服务程序. Nginx是后起之秀, ...
- postgresql 自定义聚合函数
方法1 CREATE OR REPLACE FUNCTION public.sfun_test1( results numeric[], val numeric) RETURNS numeric[] ...
- es6中的模块化
在之前的javascript中是没有模块化概念的.如果要进行模块化操作,需要引入第三方的类库.随着技术的发展,前后端分离,前端的业务变的越来越复杂化.直至ES6带来了模块化,才让javascript第 ...
- 遍历table明细是否为空
//循环遍历 <tbody id="linedata2">,获取每行值对比 $("#linedata2 tr").each(function(i,n ...
- python习题一
1.26个字母大小写成对打印,例如:Aa,Bb...... 方法1: for i in range(26): print(chr(65+i)+chr(97+i)) 方法2: for i in rang ...
- Maven Webapp项目web.xml版本记录
web.xml 2.0版本 <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3// ...
- websocket flutter
https://stackoverflow.com/questions/51077233/how-can-i-use-socket-in-flutter-app import 'dart:io'; i ...