zoukankan      html  css  js  c++  java
  • lua相关库安装常见问题

    一、先安装lua

    brew install lua

    我本机的安装路径为:/usr/local/Cellar/lua/5.3.4_2

    二、安装luarocks

    下载luarocks的安装包:

    http://luarocks.github.io/luarocks/releases/luarocks-2.4.3.tar.gz

    解压后到安装包的目录下执行如下命令(可以自行根据自己的lua版本号进行修改):

    ./configure --with-lua=/usr/local/Cellar/lua/5.3.4_2   --with-lua-include=/usr/local/Cellar/lua/5.3.4_2/include

    make 

    make install

    安装完成

    参考链接:http://www.shixinke.com/openresty/openresty-lua-luarocks

    三、安装lfs

    sudo luarocks install luafilesystem

    可能会有报错,but,anyway,安装成功了不是么

    lfs的使用:

    进入到lua的命令行,require "lfs"

    大功告成,可以正常使用了 

    引用链接:https://luarocks.org/

    四、安装luasocket和luasql

    1、首先安装luasocket

    sudo luarocks install luasocket

    2、安装luasql

    我遇到了下面的问题

    Warning: The directory '/Users/baidu/.cache/luarocks' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing /usr/local/bin/luarocks with sudo, you may want sudo's -H flag.
    Warning: falling back to curl - install luasec to get native HTTPS support
    Installing https://luarocks.org/luasql-mysql-2.3.5-1.rockspec
    
    Error: Could not find header file for MYSQL
      No file mysql.h in /usr/local/include
      No file mysql.h in /usr/include
    You may have to install MYSQL in your system and/or pass MYSQL_DIR or MYSQL_INCDIR to the luarocks command.
    Example: luarocks install luasql-mysql MYSQL_DIR=/usr/local

    看错误提示,是没有找到mysql的头文件,需要先安装一下mysql:

    mac执行下面brew install mysql命令即可安装。根据终端的打印结果,发现mysql的安装目录为/usr/local/Cellar/mysql/5.7.21。

    那继续找上面的问题:

    上面的报错提示可以用下面的命令进行安装:luarocks install luasql-mysql MYSQL_DIR=/usr/local

    不过我们的MYSQL_DIR是目录:/usr/local/Cellar/mysql/5.7.21

    所以我们改一下报错提示中的安装命令:

    sudo luarocks install luasql-mysql MYSQL_INCDIR=/usr/local/Cellar/mysql/5.7.21/include/mysql

    好了,出现下面的日志,安装成功了:

  • 相关阅读:
    normalize.css 中文版
    [转载]自适应高度输入框
    【转载】H5页面列表的无线滚动加载(前端分页)
    CSS设置table下tbody滚动条与thead对齐的方法
    [转载]Jquery mobiscroll 移动设备(手机)wap日期时间选择插件以及滑动、滚动插件
    wordpress 目录、数据结构和解析原理
    WordPress基础知识:条件判断标签及用法大全
    主题如何添加tag标签页面
    WordPress进阶:[2]不同页面显示不同的侧边栏
    WordPress进阶:[1]怎样用tag标签做导航菜单
  • 原文地址:https://www.cnblogs.com/sonofelice/p/8360959.html
Copyright © 2011-2022 走看看