xionglie@lie-mac:~ $ brew install lua ==> Downloading http://www.lua.org/ftp/lua-5.1.4.tar.gz Already downloaded: /Library/Caches/Homebrew/lua-5.1.4.tar.gz ==> Patching patching file Makefile patching file src/Makefile ######################################################################## 100.0% patching file lcode.c patching file ldblib.c patching file liolib.c patching file llex.c patching file loadlib.c patching file lstrlib.c patching file lvm.c Error: Permission denied - /usr/local/lib/lua xionglie@lie-mac:~ $ sudo brew install lua Password: Error: Cowardly refusing to `sudo brew install' You can use brew with sudo, but only if the brew executable is owned by root. However, this is both not recommended and completely unsupported so do so at your own risk. xionglie@lie-mac:~ $ ls -ld /usr/local/lib drwxr-xr-x 5 24561 wheel 170 Feb 18 17:27 /usr/local/lib #用户是24561,难道用户已经删除? #后面一查确实是权限问题,使用下面两条命令可以解决 #sudo chown -R xionglie /usr/local/include #sudo chown -R xionglie /usr/local/lib/ xionglie@lie-mac:~ $ ls -ld /usr/local/lib/lua ls: /usr/local/lib/lua: No such file or directory
使用源码安装命令
1 2 3 4 5
wget http://www.lua.org/ftp/lua-5.2.1.tar.gz tar zxf lua-5.2.1.tar.gz cd lua-5.2.1/src make macosx sudo cp lua /usr/bin/lua
#Open your Terminal.app wget http://www.lua.org/work/lua-5.2.0-alpha.tar.gz tar xvzf lua-5.2.0-alpha.tar.gz cd lua-5.2.0-alpha/src make macosx(I believe you have Xcode installed) #After that, you can see 'lua' binary under current dir. sudo cp lua /usr/bin/lua