/luaUsing

lua practice

Primary LanguageLua

env

  • macos mojave 10.14.4 (18E226)
  • vs code 版本 1.35.1 (1.35.1)
  • vs code 默认不是自动保存,file-auto save 打开,否则 lua xx.lua 啥也不输出,别被坑哭~~
  • lua version 5.3.5
  • luajit 2.0.5 兼容lua5.1

install

brew install lua

doc

luaUsing

  • lua demo.lua

kong 插件开发

兼容性

-- Provide unpack for Lua 5.3+ built without LUA_COMPAT_UNPACK
local unpack = unpack
if table.unpack then unpack = table.unpack end

  • luarocks
  • brew install luarocks
  • luarocks install luacrypto OPENSSL_DIR=/usr/local/Cellar/openssl/1.0.2r
brew upgrade openssl
If you need to have curl-openssl first in your PATH run:
  echo 'export PATH="/usr/local/opt/curl-openssl/bin:$PATH"' >> ~/.bash_profile

For compilers to find curl-openssl you may need to set:
  export LDFLAGS="-L/usr/local/opt/curl-openssl/lib"
  export CPPFLAGS="-I/usr/local/opt/curl-openssl/include"

For pkg-config to find curl-openssl you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/curl-openssl/lib/pkgconfig"