loentar / ngrest

Fast and easy C++ RESTful WebServices framework
Apache License 2.0
465 stars 94 forks source link

Cannot change to .ngrest/ngrest : No such file or directory #91

Open JL2014 opened 1 year ago

JL2014 commented 1 year ago

Hi,

With a "ngrest" compiled manually, when I apply your "Notes" example, all ngrest/grestserver are working fine, but when launch ngrest in "Notes" project, I have this error :

~/notes# ngrest
fatal: Cannot change to '/root/.ngrest/ngrest': No such file or directory

I don't know what is this ".ngrest" folder outside the "ngrest" folder or the "notes" folder.

Moreover, I see in ngrest script a reference to a local ".ngrest" folder line 41 ("if [ -f .ngrest/packages ]"), but there is a variable (NGREST_ROOT=~/.ngrest) a little above, maybe two diffrent cases, maybe a small error.

Greetings, JL.

JL2014 commented 1 year ago

Also, if I try to add "ngrest-db" into "ngrest" folder (and not in "notes" folder), I have this error :

~/ngrest# ngrest add loentar/ngrest-db sqlite
/root/.ngrest/packages/loentar/ngrest-db/scripts/ngrest-trigger: line 21: .ngrest/services: No such file or directory
loentar commented 1 year ago

If you installed it manually from source you have to maintain everything manually as well..

(Also, working under root is actually bad idea..)

JL2014 commented 1 year ago

Hi @loentar,

If you installed it manually from source you have to maintain everything manually as well..

Ok but what "maintain" to avoid these two errors ? How indicate to "ngrest" the real path of "NGREST_ROOT" because the one it uses does not exist !

My main problem is :

# build from source and install "ngrest" (from https://github.com/loentar/ngrest/wiki/Build-ngrest-from-source-code)
ngrest create Notes
cd notes
ngrest
fatal: Cannot change to '/root/.ngrest/ngrest': No such file or directory
# this folder "/root/.ngrest" doesn't exists !

(Also, working under root is actually bad idea..)

I know that, it's just for a POC ;-)

Greetings, JL.