I am trying to use luarocks to modularize my code. I created the following rock:
http://luarocks.org/modules/tyrondis/coronalog (https://github.com/tyrondis/coronalog)
In my Corona project I am installing it into a local tree:
$ luarocks install --tree lua_modules coronalog
This installs the rock into the following path:
./lua_modules/share/lua/5.1/coronalog.lua
Now I am changing lua’s search path so that I can easily include the module:
package.path = ‘lua_modules/share/lua/5.1/?.lua’ … package.path
However, after requiring the module:
local log = require(‘coronalog’)
Corona Simulator gives me the following error:
ERROR: Runtime error
module ‘coronalog’ not found:
no field package.preload[‘coronalog’]
no file ‘lua_modules/share/lua/5.1/coronalog.lua’
…
The search path lua_modules/share/lua/5.1/coronalog.lua is correct and the file definitely exists there, however, Corona Simulator is unable to load it.
Am I doing this wrong or does Corona have no support for adjusting the search path? I would really like to be able to use luarocks. Package managers are a must for modern app development.