Luarocks installation on MacOS system

Source: Internet
Author: User
Tags lua

Luarocks is a package management tool developed based on LUA, so you need to install LUA before installing luarocks (see "Lua Installs on MacOS Systems" in the same directory as the blog). The specific installation steps are as follows:

1. Source Installation Deployment Luarocks

In fact, in addition to the source code installation, we have other options to install, such as Brew,apt-get,yum, here to choose the source code installation:

$ wget http://luarocks.org/releases/luarocks-2.2.2.tar.gz$ tar zxvf luarocks- 2.2. 2. Tar . gz$ CD luarocks-2.2. 2 $ . /configure sudo make bootstrap
$ sudo luarocks install Luasocket
$ lua
> Require "socket"

Note: The above command is on the official website of the document, and Baidu to the blog inconsistent. Through the actual operation, the official website can be installed perfectly, the existing blog does not work.

The results of the output are as follows:

zfydemacbook-pro:luarocks-2.2.2zfy$./configure--helpconfigure luarocks.--Help .--prefix=DIR Prefix where luarocks should be installed. Default is/usr/Local--sysconfdir=dir location where the Configfileshould be installed. Default is $PREFIX/etc/Luarockswhere toInstallFiles installed by rocks, to MakeThe accessible to Lua andyour $PATH. Beware of clashes between files installed by Luarocks and by Yoursystem'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, or5.3Default is"5.1"--lua-suffix=suffix Versioning suffix to useinchLua 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/binif--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-dirUse a versioned rocksdir, such as $PREFIX/lib/luarocks/rocks-5.1/. Default is to auto-detect the necessity.--force-config use a single config location. Don't use the $LUAROCKS _config variable or the user's Homedirectory. Useful to avoid conflicts when Luarocks was embedded within an application.

Here we focus mainly on--prefix = DIR and--with-lua = prefix.

2. Setting--prefix and--with-lua

--prefixSet the Luarocks installation path to --with-lua specify the Lua installation path that Luarocks relies on.

Setting prefix will automatically luarocks and later use Luarocks installed LUA packages, LUAC packages are installed in the Luarocks installation path in the appropriate location, otherwise the relevant package files scattered in the file system, it is not easy to manage, if the Lua template package installed Bin file is automatically installed to the bin path under this directory, and the same path as the Luarocks executable file is easier to manage and use.

./configure--prefix=/usr/local/luarocks-2.2.2--with-lua=/users/zfy/downloads/lua-5.3.3 //Luarocks and LUA versions on my Computer

The values of the two variables,--prefix and--with-lua, depend on the location of Luarocks and Lua on your computer, and generally the luarocks location is fixed/usr/local/ luarocks-2.2.2, but Lua has different paths during installation, such as mine under/users/zfy/downloads. So be sure to first determine the position of the above two, do not blindly copy.

 Make Build  Make Install
3. Running

Run Luarocks directly at the command line.

For luarocks usage, you can check the documentation on GitHub for a limited amount of time and this article is not translated.

Luarocks installation on MacOS system

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.