mongorover icon indicating copy to clipboard operation
mongorover copied to clipboard

module 'mongo_module' not found:

Open SimonFearby opened this issue 8 years ago • 15 comments

I was hoping this could work on lua for ARM app development using the http://www.coronalabs.com SDK but the following module is missing.

module 'mongo_module' not found: no field package.preload['mongo_module']

SimonFearby avatar Jul 24 '16 06:07 SimonFearby

Could you give me a complete bug report please? What steps did you follow to reach this point? Have you installed libbson, libmongoc, and mongorover?

ajdavis avatar Jul 24 '16 10:07 ajdavis

I have the same issues as well. I believe there suppose to be a lua file call 'mongo_module' but the actual mongo_module.lua file is missing.

kwesijc avatar Jul 26 '16 01:07 kwesijc

@kwesijc: mongo_module created by compiling a .so from the c layer. Are you building anything whatsoever? Does coronalabs sdk have access to a luarocks build system? Give us some steps to help us reproduce your issue, and I'll try and help you out!

christopherjwang avatar Jul 26 '16 03:07 christopherjwang

Hi Chris,

Thanks you for your response. Answer to your questions below.

Are you building anything whatsoever?

  • Yes. I am developing a mobile application. I was experimenting to see if I can use this with Corona SDK since the primary language is Lua.

Does coronalabs sdk have access to a luarocks build system?

  • This is something I was trying to figure. Other developers I know and some on the forum saw this Lua project and will like to incorporate this into their project.

To answer your question coronalabs does not have access to a luarocks build system. One of the responses from the Corona Forums... "Corona uses it's own localized instance of Lua (this is the part where I'm making assumptions, so feel free to correct me @CoronaLabs). You can run the simulator and create builds without installing lua on your development machine, so installing modules via luarocks is not possible." link below to the full discussion on this. https://forums.coronalabs.com/topic/63043-luarocks-corona-sdk/

Somebody on the forum was trying to find a solution to this. https://forums.coronalabs.com/topic/64718-luarocks-coronasdk-attempt/

Give us some steps to help us reproduce your issue

  • You will need to download the Corona SDK application. It is free by the way. https://coronalabs.com/
  • I opened up a new project in Corona SDK and I placed the mongorover folder in my Corona project folder. Corona SDK does not have access to the luarocks build. I knew this would not work but I was just trying some workarounds. Check the screen shot below. screen shot 2016-07-28 at 1 32 42 pm

Then I use some the the examples code like below but changing some of the data to connect to my mongo database.

mongorover = require("mongorover") local MongoClient = require("mongorover.MongoClient") local client = MongoClient.new("mongodb://localhost:27017/") local exampleDatabase = client:getDatabase("exampleDB") local exampleCollection = exampleDatabase:getCollection("exampleCollection")

I was expecting an error to come up. This is my error. screen shot 2016-07-28 at 1 42 33 pm

Just a little background behind me using the Mongorover project. There are other developers who uses Corona SDK and other SDKs that uses Lua for its language of choice. Some of these developers are trying to find a lua based solution to connect there applications to Mongodb. I came across this solution and found it to be very ideal and simple to use. As for lua rocks it is great. But I was trying to get to it work for my mobile development.

My question to you is. Is it possible or a way in which your Mongo+Lua solution can be module that is not luarocks depended? Also this particular module can consist the drivers necessary where any Lua developer can download and use with their respective Lua development environment like Corona SDK or any other platform that uses Lua?

Any help, resources or pointing us to any solution will be very appreciative. I really love what you did with the mongorover project. Great job. Thank you in advance.

kwesijc avatar Jul 28 '16 18:07 kwesijc

Is it possible or a way in which your Mongo+Lua solution can be module that is not luarocks depended?

yes, we used to use CMake to compile mongorover c files, but deprecated it in favor of the LuaRocks build system.

Are you building anything whatsoever?

I apologize if this came across harsh, I was trying to reference if you were attempting to use CMake (a.k.a. a "build" system). I'm happy to help if I can :).

@kwesijc + @SimonFearby: Do either of you have a Corona Enterprise license? Only then can you have native code capabilities. I unfortunately don't have one and wouldn't be able to actually try it out. If so, they do have some documentation for using native code and we can potentially attempt that together. I'll look more into compiling a static library for iOS, as mentioned in the docs.

christopherjwang avatar Jul 29 '16 02:07 christopherjwang

Hi Chris,

Thank you for your response. I am not knowledgable about CMake and how it really works. If you were to use CMake would that make the Mongorover module dependent on its own? In order words, would anyone be able to download the folder containing the files and start using it to connect to MongoDB using their own SDK or Lua based platform? Or would we still need dependency on CMake as we do with LuaRocks?

Do either of you have a Corona Enterprise license?

  • I was able to get an enterprise license plus plugins development privileges for 30 days.
  • Please let me know your availability and when we can start so I can activate the 30 day trial.
  • You can message me offline [email protected]. That way I can give you my credentials so we can work on it together.

kwesijc avatar Jul 29 '16 19:07 kwesijc

Hey @SimonFearby @kwesijc. Sorry for the delays (I didn't get notified when @kwesijc edited the post above). I have another build system (CMake) up that we might be able to get things on Corona working. Before I move forward with this, can you confirm there still interest in making this happen?

christopherjwang avatar Aug 22 '16 10:08 christopherjwang

Hi Chris,

Thank you so much for your reply. Yes, we are still interest in making this happen. I have two questions. Would this solution be independent or flexible to where it contains all the code and resources needed to run this with Corona? Or would we need CMake on our end when developing to make this work with Corona?

In other words, when we compile our apps and publish them would the Mongorover code and resources get compiled into the app package as well and be able to run on user's individual devices?

Again, thank you so much for your time.

kwesijc avatar Aug 22 '16 16:08 kwesijc

You should just be able to add the plugin without any worries. All the compiling is the plugin developer's work (from what I can tell). Let me do some more reading and let me reach out to Corona and get more information before I give you false information.

Do you have a platform that you are looking to start out with?

christopherjwang avatar Aug 23 '16 07:08 christopherjwang

Hi Chris,

I will be working with Corona SDK and Defold SDK defold.com. They are both Lua based platforms. Defold has an option where you can add stand alone Lua module as well. But I will double check on that.

However, the one I will be started out with is Corona SDK. I have a trial of the Enterprise version. Corona labs granted me a limited trial version for the purposes of this. If you would like access to it please let me know. My email is [email protected]. I would share the credentials for the free trial version through my email.

kwesijc avatar Aug 23 '16 10:08 kwesijc

I got a corona license for plugin developers (I get two months free). I'll give it a shot (and will update as progress hopefully goes along). I'll try and make this happen, can't promise anything though :).

christopherjwang avatar Aug 24 '16 06:08 christopherjwang

Hi Chris,

Sounds good. Thank you so much for your time and effort your putting into this.

kwesijc avatar Aug 24 '16 10:08 kwesijc

Hi Chris,

Hope all is well. Just checking in on the Corona plugin. How is the progress? Does the plugin look doable?

kwesijc avatar Sep 05 '16 21:09 kwesijc

I haven't made any substantial progress, I'll keep you up to date. I'm hoping to dedicate some time to it this week.

christopherjwang avatar Sep 06 '16 17:09 christopherjwang

Hi all. I feel really embarrassed leaving you both hanging. I hit some hard obstacles and didn't continue on. I was told to contact someone on the forums that goes by the handle StarCrunch for guidance, and I just did. I'm going to do that and see if there's a transition we can do to have this on Corona SDK. mongorover is kind of weird because it has a C component and a lua component (hybrid components for Android are only Java for Corona's docs) among other things. I'll see if Corona can extend my license as well to see if this can work and we can communicate more closely over email if you'd like. I'd love some help as well if you think you're up for the task.

christopherjwang avatar Nov 30 '16 07:11 christopherjwang