0

I've seen this manifest itself when including packages from torch. The simplest example is from the "sys" package. For some reason: https://github.com/torch/sys/blob/master/init.lua#L37-L40 is returning nil when launched through OpenResty which causes an exception.

app.lua

local sys = require 'sys'

Running resty app.lua results in:

$ resty app.lua 
/Users/vanpelt/torch/install/share/lua/5.1/sys/init.lua:40: attempt to index local 's' (a nil value)

(sys.execute is being called to set sys.prefix)

I have no clue why popen is behaving strangely, but thought the nil output case should be handled. Any idea's why child processes are failing in this context?

1 Answers1

0

The problem here lies on the ' ' which on lua it has some interpretation problems which i also had( i forgot the reason whyyou need to use this, sorry).

To solve it try this:

local sys = require \'sys\'