Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are the modules installed using luarocks

Tags:

lua

luarocks

I am trying to require a module I downloaded using luarocks using

require "lualogging"

but lua (and I!) cannot find where this module was downloaded to. Here is what I did

I have used apt-get to install luarocks, and then I ran

sudo luarocks install lualogging

I then ran

luarocks list

and received the following output

Installed rocks:

lualogging
1.3.0-1 (installed) - /usr/local/lib/luarocks/rocks

luasocket
3.0rc1-1 (installed) - /usr/local/lib/luarocks/rocks

Natural this led me to believe that lualogging was located in /usr/local/lib/luarocks/rocks, but running this command

find /usr/local/lib/luarocks/rocks "lualogging.lua"

returned nothing. What am I doing wrong here? This may be related, but I cannot find what my LUA_PATH environment variable is so it may be that it was never set? I'd like to be able to run require "lualogging" from any file regardless of where it is located in the filesystem, and then log to my heart's content. But I can't even find where lualogging.lua exists...

like image 473
almel Avatar asked Jul 03 '14 20:07

almel


People also ask

How do I set up LuaRocks?

To install Luarocks, you first need to install Lua. On Windows and Mac, you can download and install Lua from the website. Once Lua is installed, install Luarocks. If you're on Linux, the luarocks command is available in your distribution's repository.

Does Lua have a package manager?

LuaRocks is the package manager for Lua modules. LuaRocks is free software and uses the same license as Lua.

How do I install LuaRocks on Windows?

if you already have a Lua installation, the single binary package which you can use: get the latest windows-32. zip file here, unpack it and you'll have a luarocks.exe ready to use. Make sure the executable is available from your executable PATH so you can run luarocks from the command line the same way you run lua.


2 Answers

Run luarocks show lualogging. It will list all modules and where they are.

like image 88
Hisham H M Avatar answered Sep 21 '22 12:09

Hisham H M


It should be require "logging" not require "lualogging"

like image 44
Max Avatar answered Sep 18 '22 12:09

Max