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

Getting "attempt to call method 'new' (a nil value)" when running the test code. #8

Closed
bnferguson opened this issue May 4, 2013 · 4 comments

Comments

@bnferguson
Copy link

Running into this error even with the simplest code.

mongol = require "resty.mongol"
conn = mongol:new() 

Get the "attempt to call method 'new' (a nil value)" error on line 2.

Running off of github clone. Basic Lua hello world is working in Openresty. Any clues?

@bnferguson
Copy link
Author

Here's the full error output in nginx's error log: https://gist.github.com/bnferguson/24f40f891b3e04501408

@bigplum
Copy link
Owner

bigplum commented May 7, 2013

Sorry for late response, please try to add "local" ahead of mongol:

    local mongo = require "resty.mongol"
    conn = mongo:new()

@bnferguson
Copy link
Author

Progress! I could have sworn I tried that but apparently I did not. Thanks so much! (now to pick my local Lua experts brain as to what I was missing)

@marcqualie
Copy link

This is marked as resolved but it's still broken for me (even by putting local). I've opened a new issue over at #15 but I was just wondering if there was anything I might have missed that this ticket was resolved by.

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

3 participants