Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

resty modules not in seasrch path #7

Closed
mche opened this issue Apr 29, 2016 · 3 comments
Closed

resty modules not in seasrch path #7

mche opened this issue Apr 29, 2016 · 3 comments

Comments

@mche
Copy link

mche commented Apr 29, 2016

HI!

I did compile openresty as: $ ./configure --prefix=$HOME/openresty; make install
Then run: $ ~/openresty/luajit/bin/luajit

local mysql = require "resty.mysql"

stdin:1: module 'resty.mysql' not found:
no field package.preload['resty.mysql']
no file './resty/mysql.lua'
no file '/home/foo/openresty/luajit/share/luajit-2.1.0-beta1/resty/mysql.lua'
no file '/usr/local/share/lua/5.1/resty/mysql.lua'
no file '/usr/local/share/lua/5.1/resty/mysql/init.lua'
no file '/home/foo/openresty/luajit/share/lua/5.1/resty/mysql.lua'
no file '/home/foo/openresty/luajit/share/lua/5.1/resty/mysql/init.lua'
no file './resty/mysql.so'
no file '/usr/local/lib/lua/5.1/resty/mysql.so'
no file '/home/foo/openresty/luajit/lib/lua/5.1/resty/mysql.so'
no file '/usr/local/lib/lua/5.1/loadall.so'
no file './resty.so'
no file '/usr/local/lib/lua/5.1/resty.so'
no file '/home/foo/openresty/luajit/lib/lua/5.1/resty.so'
no file '/usr/local/lib/lua/5.1/loadall.so'

Why path "{openresty-prefix}/lualib" is not included by default in luajit openresty??? This is incorrect.

P.S.

As I see in http://luajit.org/install.html that possible to

make PREFIX={openresty-prefix}/lualib (not to be confused with make **install** PREFIX=...)

I think that needs to add in ./configure script. May be new option "--with-luajit-extralib=..." with default?

@mche
Copy link
Author

mche commented Apr 29, 2016

Oh, sorry

attempt to index global 'ngx' (a nil value)

Issue incorrect

@agentzh
Copy link
Member

agentzh commented Apr 29, 2016

@mche The luajit binary cannot run those lua-resty-* libraries in the first place because the official luajit does not have OpenResty's Lua API, for obvious reasons.

I think you should really invoke the resty command-line utility instead, which is under {openresty-prefix}/bin/. See

https://github.com/openresty/resty-cli

for more details.

@mche
Copy link
Author

mche commented May 3, 2016

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants