Lua: Install a rock using luarocks from a locally installed rock (or from a .zip/.tar.gz)

likethesky picture likethesky · Sep 3, 2012 · Viewed 13.4k times · Source

I hunted around but I couldn't determine if this is possible.

Basically, http://luarocks.org is down, and I already have a copy of luafilesystem installed on another machine locally here. With Ruby, it's possible to cross install ruby gems using the 'gem' command locally. I'm wondering if the same is possible with rocks and luarocks.

Is there any way to 'cross-install' a rock (for instance, luafilesystem), by using another local installation of that rock?

Something like:

luarocks install //10.0.1.123/machine/path/to/luafilesystem/on/other/machine

is what I'd like to be able to do.

UPDATE: I'd even be happy with how to install a rock from the .tar.gz or .zip, for instance, if I downloaded one of the images from this location (in the case of LuaFileSystem).

In which case, the 'source' for the install would / could be local to the machine, rather than remote (and wouldn't necessarily already be installed as a rock).

Answer

Robert Wahler picture Robert Wahler · Oct 15, 2012

If you have the source zip, you can unpack it and point luarocks to the the rockspec file. Here is how I installed 'busted' from source.

git clone https://github.com/Olivine-Labs/busted.git
luarocks install busted/busted-1.3-1.rockspec

Or install it directly from source

cd busted
luarocks make