lua在mac上的安装以及遇到Permission denied
Mac OS X 系统上安装lua 5.3.0版本,输入:
curl-R-O http://www.lua.org/ftp/lua-5.3.0.tar.gz
下载压缩包,再输入
tar zxf lua-5.3.0.tar.gz
解压,然后进入lua-5.3.0目录
cd lua-5.3.0
执行
make macosx test
最后安装
make install
运行完最后这条命令之后可能会报错:
appledeMacBook-Pro:lua-5.3.0 apple$ make install
cd src && mkdir -p /usr/local/bin /usr/local/include /usr/local/lib /usr/local/man/man1 /usr/local/share/lua/5.3 /usr/local/lib/lua/5.3
mkdir: /usr/local/include: Permission denied
mkdir: /usr/local/lib: Permission denied
mkdir: /usr/local/man/man1: Permission denied
mkdir: /usr/local/share/lua/5.3: Permission denied
mkdir: /usr/local/lib/lua/5.3: Permission denied
make: *** [install] Error 1
这是因为普通用户没有管理员的权限,输入”sudo make install“,然后会提示你输入密码,输入开机密码之后,就能正常安装了
最后输入
appledeMacBook-Pro:lua-5.3.0 apple$ lua -v
Lua 5.3.0 Copyright (C) 1994-2015 Lua.org, PUC-Rio
可以查看lua的版本号