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下 ...
随机推荐
- VersionCode和VersionName
关于apk更新版本的问题 先上结论: Google为APK定义了两个关于版本属性:VersionCode和VersionName,他们有不同的用途. VersionCode:对消费者不可见,仅用于 ...
- PagerSlidingTabStrip
https://github.com/jpardogo/PagerSlidingTabStrip
- NSUInteger和NSInteger和int
int和NSInteger其实是差不多的,但更推荐使用NSInteger,因为使用NSInteger,这样就不用考虑设备是32位还是64位了. NSUInteger是无符号的,即没有负数,NSInte ...
- Android 读取手机短信
获取android手机短信需要在AndroidManifest.xml加权限: <uses-permission android:name="android.permission.RE ...
- 【转】开发者分享如何创造一款优秀的iOS游戏——2013-08-25 17
http://game.dapps.net/gamedev/experience/889.html 创造出<Temple Run>的夫妻团队在高峰时期每天能够获得"好几万&quo ...
- linux 定时任务计划
crond: unrecognized service 无crond解决办法 安装计划任务:yum -y install vixie-cron
- [转]VS2010 (C#)winform程序打包发布图解
1.新建一个Windows窗体应用程序,例如项目名为monitor,功能略.新建的时候不要忘了创建解决方案. 2.在monitor解决方案上“右击”—— “添加”——“新建项目”,选择“其他类型项目” ...
- 判断URL是否存在
判断URL是否存在 判断网址是否存在,可以使用下面方面处理.如果HttpStatusCode为OK,说明网址存在.
- commons-io源码阅读心得
FileCleanTracker: 开启一个守护线程在后台默默的删除文件. /* * Licensed to the Apache Software Foundation (ASF) under on ...
- RazorEngine在非MVC下的使用,以及使用自定义模板
---恢复内容开始--- RazorEngine模板引擎大大的帮助了我们简化字符串的拼接与方法的调用,开源之后,现在在简单的web程序,winform程序,甚至控制台程序都可以利用它来完成. 但如何在 ...