anjia0532 / lua-resty-maxminddb

A Lua library for reading MaxMind's Geolocation database

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

bad argument #1 to 'concat' (table expected, got nil)

zhezi7 opened this issue · comments

maxminddb.lua:323: bad argument #1 to 'concat' (table expected, got nil)
stack traceback:
coroutine 0:
[C]: in function 'concat'
/Users/suriko/apps/openresty/lualib/resty/maxminddb.lua:323: in function 'lookup'

commented

share your code plz.

commented

local _,status,resultTap = _dump_entry_data_list(entry_data_list)
if status ~= MMDB_SUCCESS then
return nil,'no data'
end
return json_decode(table.concat(resultTab)),nil

image

please see the picture

commented
  1. install all of the prerequisites https://github.com/anjia0532/lua-resty-maxminddb#prerequisites
  2. maxminddb's version
  3. invoke code

I find what I changed, when it loaded, it shows an error about maxminddb,
maxminddb.lua:151: dlopen(libmaxminddb.so, 5): image not found
So I changed from
local maxm = ffi.load('libmaxminddb.so') to
local maxm = ffi.load('libmaxminddb.dylib')
Maybe that's the reason.

I use Mac, do you know why it shows the error:
maxminddb.lua:151: dlopen(libmaxminddb.so, 5): image not found