As LuaRocks is unfortunately not part of the FreeBSD ports collection, it has to be compiled manually. As I'm going to need to repeat this process in the foreseeable future, I decided to document the required steps here.
The reason why I'm targeting Lua 5.1 specifically is that I'm installing Luarocks to build rocks to be used with the Nginx Lua module, as I plan to migrate the Telize server to FreeBSD.
pkg install lua51 gmake curl
curl -O http://luarocks.org/releases/luarocks-2.2.0.tar.gz tar xvfz luarocks-2.2.0.tar.gz cd luarocks-2.2.0 ./configure --with-lua-include=/usr/local/include/lua51 --with-downloader=curl make build && make install make bootstrap
luarocks build lua-cjson luarocks build lua-iconv
ls /usr/local/lib/lua/5.1 cjson.so iconv.so