# Luarocks

- Page: https://shared.btbytes.com/p/luarocks
- Date: 2020-12-25
- Tags: lua

When you have multiple lua installations, installing libraries for one of those using luarocks:

    luarocks --lua-dir=/usr/local/opt/lua@5.1 install say

To install into a custom location, use the `--tree /dir/locn` option

    mkdir -p lenv
    luarocks install --tree lenv fennel

Further exploration:

- [Pinning versions with a lock file](https://github.com/luarocks/luarocks/wiki/Pinning-versions-with-a-lock-file)
- what is the equivalent of Python's `requirements.txt`? -- A `rockspec`. See [Creating a rock](https://github.com/luarocks/luarocks/wiki/Creating-a-rock)
