I got the below while trying to use luarocks. Looks like it was checking out Lua 5.1 while I have moved up to 5.2
rmicro@ubuntu:~/Downloads/luarocks-0.1$ luarocks install luasocket
Archive: /tmp/luarocks_luarocks-rock-luasocket-2.0.2-5-5764/luasocket-2.0.2-5.src.rock
inflating: luasocket-2.0.2-5.rockspec
inflating: luasocket-2.0.2.tar.gz
cd src; make all
make[1]: Entering directory `/tmp/luarocks_luasocket-2.0.2-5-3165/luasocket-2.0.2/src'
gcc -O2 -DLUASOCKET_DEBUG -I/usr/include/lua5.1 -c -o luasocket.o luasocket.c
gcc -O2 -DLUASOCKET_DEBUG -I/usr/include/lua5.1 -c -o timeout.o timeout.c
gcc -O2 -DLUASOCKET_DEBUG -I/usr/include/lua5.1 -c -o buffer.o buffer.c
gcc -O2 -DLUASOCKET_DEBUG -I/usr/include/lua5.1 -c -o io.o io.c
gcc -O2 -DLUASOCKET_DEBUG -I/usr/include/lua5.1 -c -o auxiliar.o auxiliar.c
gcc -O2 -DLUASOCKET_DEBUG -I/usr/include/lua5.1 -c -o options.o options.c
gcc -O2 -DLUASOCKET_DEBUG -I/usr/include/lua5.1 -c -o inet.o inet.c
gcc -O2 -DLUASOCKET_DEBUG -I/usr/include/lua5.1 -c -o tcp.o tcp.c
gcc -O2 -DLUASOCKET_DEBUG -I/usr/include/lua5.1 -c -o udp.o udp.c
gcc -O2 -DLUASOCKET_DEBUG -I/usr/include/lua5.1 -c -o except.o except.c
gcc -O2 -DLUASOCKET_DEBUG -I/usr/include/lua5.1 -c -o select.o select.c
gcc -O2 -DLUASOCKET_DEBUG -I/usr/include/lua5.1 -c -o usocket.o usocket.c
gcc -shared -O -fpic -o socket.so.2.0.2 luasocket.o timeout.o buffer.o io.o auxiliar.o options.o inet.o tcp.o udp.o except.o select.o usocket.o
/usr/bin/ld: luasocket.o: relocation R_X86_64_32 against `.data' can not be used when making a shared object; recompile with -fPIC
luasocket.o: could not read symbols: Bad value
collect2: ld returned 1 exit status
make[1]: *** [socket.so.2.0.2] Error 1
make[1]: Leaving directory `/tmp/luarocks_luasocket-2.0.2-5-3165/luasocket-2.0.2/src'
make: *** [all] Error 2
Error: Build error: Failed building.
rmicro@ubuntu:~/Downloads/luarocks-0.1$ lua -v
Lua 5.2.0 Copyright (C) 1994-2011 Lua.org, PUC-Rio
rmicro@ubuntu:~/Downloads/luarocks-0.1$