• Luarocks 安装艰难过程


    1.最好新建一个你自己的目录,然后把lua + Luarocks 都安装在这个文件夹下面,方便以后维护

    2.安装lua环境

    $ wget http://www.lua.org/ftp/lua-5.3.0.tar.gz 
    $ tar zxvf lua-5.3.0.tar.gz 
    $ cd lua-5.3.0 
    $ vi Makefile 
    INSTALL_TOP= /usr/local/lua-5.3.0 --指定安装的目录

    $ make linux 
    $ make install

    3. 安装luarocks 环境

    $ wget http://keplerproject.github.io/luarocks/releases/luarocks-2.2.2.tar.gz  

    $ tar -xzvf luarocks-2.2.2.tar.gz  

    $ cd luarocks-2.2.2  

    $ ./configure --prefix=/usr/local/luarocks-2.2.2 --with-lua=/usr/local/lua-5.3.0 (luarocks-2.2.2 所在目录,lua-5.3.0配置的安装目录INSTALL_TOP= /usr/local/lua-5.3.0 --指定安装的目录

    $ make build  

    $ make install 

    4.重点来了,我执行 ./configure  --prefix=/usr/local/luarocks-2.2.2 --with-lua=/usr/local/lua-5.3.0 一直报下面的错误

    报错信息:[root@test-l27-15-165 luarocks-2.2.2]# ./configure --prefix=/usr/fxj/luarocks-2.2.2 --with-lua=/usr/local/include/

    Checking Lua interpreter... lua not found (looked in /usr/local/include//bin)

    You may want to use the flag --with-lua or --with-lua-bin. See --help.

    configure failed.

    那么这个路径具体该怎么设置呢?

    luarocks-2.2.2这会是这个解压包所在的路径,/usr/local/lua-5.3.0这个是INSTALL_TOP= /usr/local/lua-5.3.0 

    [root@test-l27-15-165 luarocks-2.2.2]# ./configure --prefix=/usr/fxj/luarocks-2.2.2 --with-lua=/usr/local/lua-5.3.0
    Lua interpreter found: /usr/local/lua-5.3.0/bin/lua...
    Lua version detected: 5.3
    Checking Lua includes... lua.h found in /usr/local/lua-5.3.0/include/lua.h
    curl found at /usr/bin
    md5sum found at /usr/bin
    Configuring for system... Linux
    Configuring for architecture... x86_64
    Using unversioned rocks dir: /usr/fxj/luarocks-2.2.2/lib/luarocks/rocks
    Writing configuration...

    Installation prefix: /usr/fxj/luarocks-2.2.2
    LuaRocks configuration directory: /usr/fxj/luarocks-2.2.2/etc/luarocks
    Using Lua from: /usr/local/lua-5.3.0

    Done configuring.
    - Type 'make build' and 'make install':
    to install to /usr/fxj/luarocks-2.2.2 as usual.
    - Type 'make bootstrap':
    to install LuaRocks in /usr/fxj/luarocks-2.2.2 as a rock.

     蓝色为结果

    提示找不到lua.h,默认情况下会从/usr下寻找

    再次执行:

    [root@test-l27-15-165 luarocks-2.2.2]# find / -name = lua.h
    find: paths must precede expression: lua.h
    Usage: find [-H] [-L] [-P] [-Olevel] [-D help|tree|search|stat|rates|opt|exec] [path...] [expression]
    [root@test-l27-15-165 luarocks-2.2.2]# find / -name lua.h
    /usr/fxj/lua-5.3.0/src/lua.h
    /usr/local/include/lua.h
    /usr/local/lua-5.3.0/include/lua.h

    再次执行下面这个命令:

    ./configure --with-lua=/usr/local --with-lua-include=/usr/local/include

    $ make build  

    $ make install 

    5.输入下面验证是否安装成功:

    [root@test-l27-15-165 luarocks-2.2.2]# luarocks

    LuaRocks 2.2.2, a module deployment system for Lua

    NAME
    /usr/local/bin/luarocks - LuaRocks main command-line interface

    SYNOPSIS
    /usr/local/bin/luarocks [--from=<server> | --only-from=<server>] [--to=<tree>] [VAR=VALUE]... <command> [<argument>

  • 相关阅读:
    redis 定义序列号
    mac下搭建phalcon扩展以及phalcon-devtools扩展
    rabbitmq集群架构(转载)
    mysql下limit分页优化思路
    ffmpeg图片格式转换,webp转换成jpg,webp转换成png,jpg转换成png,jpg转换成webp,png转换成webp,png转换成jpg
    sed替换多个字符串在一条命令里面
    CentOS7减轻DDOS攻击,使用fail2ban预防CC攻击
    ffmpeg改变jpg,png,webp图片大小
    wget下载github的releases的软件
    CentOS6.5设置IPTables防火墙
  • 原文地址:https://www.cnblogs.com/fanxiaojuan/p/11551268.html
Copyright © 2020-2023  润新知