luarocks在macOS系统上的安装
luarocks是基于lua开发的一个包管理工具,所以在安装luarocks之前需要先安装lua(见博客同目录下“lua在MacOS系统上的安装”)。具体的安装步骤如下:
1.源码安装部署luarocks
其实除了源码安装,我们还有其他可以选择的安装方法,比如brew,apt-get,yum等,这里选择源码安装:
$ wget http://luarocks.org/releases/luarocks-2.2.2.tar.gz
$ tar zxvf luarocks-2.2..tar.gz
$ cd luarocks-2.2.
$ ./configure sudo make bootstrap
$ sudo luarocks install luasocket
$ lua
> require "socket"
注:上面的命令是官网的文档里的,与百度到的博客不一致。经实际操作,官网上的可以完美安装,现有博客上的不行。
输出的结果如下:
zfydeMacBook-Pro:luarocks-2.2. zfy$ ./configure --help
Configure LuaRocks. --help This help.
--prefix=DIR Prefix where LuaRocks should be installed.
Default is /usr/local
--sysconfdir=DIR Location where the config file should be installed.
Default is $PREFIX/etc/luarocks Where to install files installed by rocks, to make the accessible to Lua and
your $PATH. Beware of clashes between files installed by LuaRocks and by your
system's package manager. --rocks-tree=DIR Root of the local tree of installed rocks.
Default is $PREFIX --lua-version=VERSION Use specific Lua version: 5.1, 5.2, or 5.3
Default is "5.1"
--lua-suffix=SUFFIX Versioning suffix to use in Lua filenames.
Default is "" (lua...)
--with-lua=PREFIX Use Lua from given prefix.
Default is auto-detected (the parent directory of $LUA_BINDIR).
--with-lua-bin=DIR You can also specify Lua's bin dir.
Default is the directory of the auto-detected Lua interpreter,
or $LUA_DIR/bin if --with-lua is used.
--with-lua-include=DIR You can also specify Lua's includes dir.
Default is $LUA_DIR/include
--with-lua-lib=DIR You can also specify Lua's libraries dir.
Default is $LUA_DIR/lib
--with-downloader=TOOL Which tool to use as a downloader.
Valid options are: curl, wget.
Default is to auto-detect.
--with-md5-checker=TOOL Which tool to use as a downloader.
Valid options are: md5sum, openssl
Default is to auto-detect.
--versioned-rocks-dir Use a versioned rocks dir, such as
$PREFIX/lib/luarocks/rocks-5.1/.
Default is to auto-detect the necessity.
--force-config Use a single config location. Do not use the
$LUAROCKS_CONFIG variable or the user's home
directory. Useful to avoid conflicts when LuaRocks
is embedded within an application.
这里我们主要关注--prefix = DIR 和 --with-lua = PREFIX.
2.设置--prefix和--with-lua
--prefix 设置 Luarocks 安装路径,--with-lua 指定 Luarocks 依赖的 Lua 安装路径。
设置 prefix 会自动将 Luarocks 以及往后使用 Luarocks 安装的 Lua 包,LuaC 包都安装到 Luarocks 安装路径下的相应位置,否则相关的包文件散落在文件系统中,显得杂乱不便于管理,如果所安装的 Lua 模板包含 bin 文件,则会自动安装到此目录下的 bin 路径,与 Luarocks 可执行文件同一路径,更便于管理、使用。
./configure --prefix=/usr/local/luarocks-2.2.2 --with-lua=/Users/zfy/Downloads/lua-5.3.3//我电脑上luarocks和lua的相应版本
//--prefix和--with-lua这两个变量的值取决于你电脑上luarocks和lua的位置,一般来说luarocks的位置是固定的/usr/local/luarocks-2.2.2,但是lua在安装的时候路径各不相同,比如说我的在/Users/zfy/Downloads下。所以请务必先确定上述两者的位置,不要一味照搬。
make build
make install
3.运行
直接在命令行运行luarocks即可。
关于luarocks的用法可查看github上的说明文档,时间有限,本文暂时不翻译了。
luarocks在macOS系统上的安装的更多相关文章
- lua在MacOS系统上的安装方法
lua是一种非常小巧的脚本语言,由标准C编写而成,可以很方便的调用c/c++或者被c/c++.另外相关的还有一个luaJIT,是lua在某些平台上的编译器. 我们在这里只安装lua. 1.检测电脑上是 ...
- Oracle 支持在具有 DHCP 分配的 IP 地址的系统上进行安装
今天在安装Oracle 10g的时候,遇到了“ Oracle 支持在具有 DHCP 分配的 IP 地址的系统上进行安装” 这个问题,经过搜索,找到了解决方案,具体如下: win7下右键单机" ...
- 在64位系统上不能安装Matlab notebook的解决方案
在64位系统上不能安装Matlab notebook的解决方案 过程分解 第一步:安装好matlab(附:Matalab R2015a界面) 第二步:在matlab中执行命令 >>note ...
- Kubernetes+Docker的云平台在CentOS7系统上的安装
Kubernetes+Docker的云平台在CentOS7系统上的安装 1.运行VirtualBox5. 2.安装CentOS7系统. 注意:选择Basic Server类型 安装过程略. 3.修改计 ...
- Python3: Windows系统上同时安装Python2和Python3
Python3: Windows系统上同时安装Python2和Python3 为什么要同时安装Python2和Python3环境呢? 因为一些库只支持Python2或者Python3; 在同一台电脑上 ...
- CentOS 6.4 系统上如何安装 tomcat 8
CentOS 6.4 系统上如何安装 tomcat 8 本文将详细讲解在Linux系统上如何安装tomcat,tomcat是没有32位和64位之分的. 1.下载tomcat 首先我们肯定要先下载tom ...
- Macos系统编译percona及部分函数在Macos系统上运算差异
欢迎来到 GreatSQL社区分享的MySQL技术文章,如有疑问或想学习的内容,可以在下方评论区留言,看到后会进行解答 本文来源:原创投稿 GreatSQL社区原创内容未经授权不得随意使用,转载请联系 ...
- openssh 在32位、64位操作系统上的安装配置
openssh是安装在windows系统上的提供SSH服务的服务端软件,可以提供安全的命令行远程连接管理.下面介绍下openssh成功安装使用的操作步骤. 工具/原料 openssh window ...
- MacOS系统下简单安装以及配置MongoDB数据库(一)
最近写了一个用node来操作MongoDB完成增.删.改.查.排序.分页功能的示例,并且已经放在了服务器上地址:http://39.105.32.180:3333. 项目一共四部分: 1.MacOS下 ...
随机推荐
- C++库研究笔记——生成一组随机数
当试图用 srand(time(0)) rand() 生成一组随机数时发现,生成的数字很多都是「一样」的 经过测试:srand(seed); rand() 生成随机数,当seed一样时,生成的随机数相 ...
- WinDbug抓取进程dump
安装WinDbug(包含在 Windows Kits-debugger 中)后,运行如下命令将会在 explorer.exe进程发生崩溃后抓取相应的内存数据到D盘根目录下的一个文件夹中 adplus. ...
- [HTTP] Origins, CROS, Preflight
Origins made up of three parts the data scheme, the hostname and the prot. It is important to know t ...
- Cookie中的三个容器request,session,application的设置和获取
public class SaveServlet extends HttpServlet { public void doGet(HttpServletRequest request, HttpSer ...
- input 的 placeholder属性在IE8下的兼容处理
placeholder是input标签的新属性,在使用的时候有两个问题: 1.IE8 下不兼容 处理思路: 如果浏览器不识别placeholder属性,给input添加类名placeholder,模仿 ...
- IDispose(), Finalize()
C# using 用法: 1. 作为指令,用于为命名空间创建别名或导入其他命名空间中定义的类型.(见例1-1) 2. 作为语句,用于定义一个范围,在此范围的末尾将释放对象.(见例1-2) (例子1- ...
- js验证
验证短日期(2007-06-05) function strDateTime(str) { var r = str.match(/^(\d{1,4})(-|\/)(\d{1,2})\2(\d{1 ...
- jBPM5 vs Actitivi
http://www.blogways.net/blog/2013/07/16/activiti-jbpm-compare.html jBPM是目前市场上主流开源工作引擎之一,在创建者Tom Baey ...
- cookie和session可能需要知道的知识
做Android程序员,了解服务器的知识是相当重要的,比如cookie和session. 首先介绍一点背景知识,我们知道HTTP的连接是无状态的,HTTPS只是增加了安全,有了SSL证书来验证,作为服 ...
- JavaMail组件实现邮件功能
实现邮件收发功能需要3个jar包: 1.JavaMail组件保内的mail.jar和smtp.jar包 2.JAF组件包里的activition.jar. 复制到WebRoot/WEB-INF/lib ...