lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Axel Etzold wrote:
Dear all,

some days ago, with expert help, I have been able to make
the lpeg library. The included test.lua script ran without problem.
But I can't require lpeg from another directory. This script:

cat dois.lua


require("/usr/local/lpeg-0.7/lpeg")

local b= lpeg.R("09")^1
print(b)

gives me:

no field package.preload['/usr/local/lpeg-0.7/lpeg']

On the web, I searched for similar error messages, but there,
there was always a *.lua /*.luac file that needed some path
information for its retrieval. Now, in my directory /usr/local/lpeg-0.7/
I got this:

doc.html   lpeg-128.gif  lpeg.c  lpeg.so  makefile  re.lua  test.lua
Thank you for your help!

Best regards,

Axel

Try replacing

require("/usr/local/lpeg-0.7/lpeg")

with

package.cpath = "/usr/local/lpeg-0.7/?.so;" .. package.cpath
require("lpeg")