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 ...
随机推荐
- [LeetCode] 120. Triangle _Medium tag: Dynamic Programming
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent n ...
- git上clone需要ssh时
在命令行中输入ssh-keygen -t rsa -C "your_email@example.com" 然后使用编辑器打开id_rsa.pub文件,复制里面的ssh
- Leetcode: Number Complement
Given a positive integer, output its complement number. The complement strategy is to flip the bits ...
- 解决:启用多线程调用webBrowsers函数报错:指定的转换无效
这里就需要委托. 定义一个 委托.加载之后给他绑定一个方法Callback,也就是所说的回掉函数. 然后写一个线程,线程需要一个object 的参数.将你定义的委托当作参数传进线程中的方法. 在线程中 ...
- 配置php环境的一个nginx.conf
文件:nginx.conf 内容: #user nobody;worker_processes 1; #error_log logs/error.log;#error_log logs/err ...
- HTTP笔记1
传输层:提供进程地址 TCP:传输控制协议,面向连接的协议:通信前需要建立虚拟链路:结束后拆除链路.端口号:0-65535 UDP:用户报文协议,无连接的协议.端口号:0-65535 IANA(互联网 ...
- PHP的openssl加密
PHP的openssl扩展 openssl扩展使用openssl加密扩展包,封装了多个用于加密解密相关的PHP函数,极大地方便了对数据的加密解密. 常用的函数有: 对称加密相关: string ope ...
- java 执行https的请求
普通的get和post请求只能执行http的请求,遇到的了https的就歇菜了,需要SSL安全证书处理. 该方法只能用jdk1.7和1.8进行处理,jdk1.6会报Could not generate ...
- CentOS 7Google浏览器
CentOS 7安装并启动Google浏览器(★firecat亲测有效★) 2018年09月23日 12:42:47 libaineu2004 阅读数:3088 版权声明:本文为博主原创文章,未 ...
- [转载]URI 源码分析
需要提前了解下什么是URI,及URI和URL的区别: URI. URL 和 URN 的区别 URI 引用包括最多三个部分:模式.模式特定部分和片段标识符.一般为: 模式:模式特定部分:片段 如果省略模 ...