WebReflection / dblite

sqlite for node.js without gyp problems
MIT License
209 stars 34 forks source link

Ubuntu gives me a EACCES error #10

Closed jansmolders86 closed 10 years ago

jansmolders86 commented 10 years ago

Hi there,

I've been using DBlite with great success and I'm very grateful! I have a question about running DBlite in Linux.

I've been developing in Windows without issues and I am now testing on Linux. I have the following code:

 // Init Database
 dblite.bin = "./lib/database/sqlite3";
 var db = dblite('./lib/database/mcjs.sqlite');

In the database folder I have the binaries for both Linux and Windows. I've tried without having the mcjs.sqlite present and with the file already in place.

But I keep getting the following error:

Events.js:72
throw er; // unhandled 'error' event

Error: spawn EACCES

When I remove the DBlite code the error disappears. I also tried installing sqlite3 with apt-get and settings read and write permissions on the folder.

Do you know what I'm doing wrong by any change?

Thanks again, Jan

jansmolders86 commented 10 years ago

I'm very sorry, I already fixed it!

I solved it by setting the folder permissions correctly. It works by settings read/write and execute permissions on the entire app.

  sudo chmod -R a+rwx APPNAME/

Thanks again!

WebReflection commented 10 years ago

glad you solved it. However, I don't need to change anything in the folder if the file is not in the same folder the sqlite3 file is ... you should consider a local folder or a user defined one for your db.

Cheers

jansmolders86 commented 10 years ago

That is very usefull information, I'll do that. Thanks again!