Help me test orbit example blog!

37 views
Skip to first unread message

Joh Journeyer J.

unread,
Jan 15, 2015, 3:00:47 AM1/15/15
to kepler-...@googlegroups.com
Hi,

I tested orbit again.
But I am facing new problems..
Please help me!

I installed orbit as shown below:

sudo apt-get install luarocks
sudo apt-get install sqlite3 libsqlite3-0 libsqlite3-dev
(sudo updatedb)
(sudo locate sqlite3.h)
(/usr/include/sqlite3.h)
sudo luarocks install luasql-sqlite3
sudo luarocks install orbit
(sudo updatedb)
(sudo locate blog.lua)
(/usr/local/lib/luarocks/rocks/orbit/2.2.2-1/samples/blog/blog.lua)
 
And then, when I try the command below get some error messages:

#:/usr/local/lib/luarocks/rocks/orbit/2.2.2-1/samples/blog$ sudo orbit blog.lua
/usr/bin/lua: ...b/luarocks/rocks/orbit/2.2.2-1/samples/blog/blog.lua:32: attempt to index field 'cache' (a nil value)
stack traceback:
        ...b/luarocks/rocks/orbit/2.2.2-1/samples/blog/blog.lua:32: in function 'app_func'
        ...usr/local/lib/luarocks/rocks/orbit/2.2.2-1/bin/orbit:87: in main chunk
        [C]: ?

So I tested like this below :

 32 -- local cache = orbit.cache.new(blog, cache_path)
 33 local cache = orcache.new(blog, cache_path)

The result again is some error...

/usr/bin/lua: /usr/local/share/lua/5.1/orbit/model.lua:325: LuaSQL: no such table: post
stack traceback:
        [C]: in function 'error'
        /usr/local/share/lua/5.1/orbit/model.lua:325: in function </usr/local/share/lua/5.1/orbit/model.lua:317>
        (tail call): ?
        ...b/luarocks/rocks/orbit/2.2.2-1/samples/blog/blog.lua:41: in function 'app_func'
        ...usr/local/lib/luarocks/rocks/orbit/2.2.2-1/bin/orbit:87: in main chunk
        [C]: ?

Is this known problme?
Or did I do something wrong?

Thank you very much in advance..

Sincerely
Journeyer

Joh Journeyer J.

unread,
Jan 15, 2015, 3:07:42 AM1/15/15
to kepler-...@googlegroups.com
Hi I use Lua 5.1.5  Copyright (C) 1994-2012 Lua.org, PUC-Rio


2015년 1월 15일 목요일 오후 5시 0분 47초 UTC+9, Joh Journeyer J. 님의 말:

Ryan Pusztai

unread,
Jan 15, 2015, 11:09:55 AM1/15/15
to Kepler Project mailing list
Hi Joh,

My guess is that sqlite creates an empty database if one does not exist and I bet it does not exist for the example. You will need to create it with the proper table structure then the blog example should work. I used the tutorial [1] as the way for me to test out Orbit, not the examples delivered by luarocks. 

Joh Journeyer J.

unread,
Jan 15, 2015, 8:12:20 PM1/15/15
to kepler-...@googlegroups.com
Hi Ryan,

I've fixed errors in blog.lua.

32c32
< local cache = orbit.cache.new(blog, cache_path)
---
> local cache = orcache.new(blog, cache_path)
40c40
< posts = blog:model "post"
---
> posts = blog:model "blog_post"
77c77
< comments = blog:model "comment"
---
> comments = blog:model "blog_comment"
90c90
< pages = blog:model "page"
---
> pages = blog:model "blog_page"

I wish this be applied to the luarocks repository.

Thank you for the hint.

Regards
Journeyer

2015년 1월 16일 금요일 오전 1시 9분 55초 UTC+9, RJP Computing 님의 말:

Ryan Pusztai

unread,
Jan 16, 2015, 10:18:42 AM1/16/15
to Kepler Project mailing list
Hi Joh,

Can you try to install Orbit "development" version? I think these issues are fixed already.

$ luarocks --from=http://rocks.moonscript.org/dev install orbit cvs-3

--
Regards,
Ryan

--
You received this message because you are subscribed to the Google Groups "Kepler Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kepler-projec...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Joh Journeyer J.

unread,
Jan 20, 2015, 3:37:16 AM1/20/15
to kepler-...@googlegroups.com
Hi Ryan,

I did try the development version of orbit.
And found that the one below is applied.

32c32
< local cache = orbit.cache.new(blog, cache_path)
---
> local cache = orcache.new(blog, cache_path)


But not others!!

40c40
< posts = blog:model "post"
---
> posts = blog:model "blog_post"
77c77
< comments = blog:model "comment"
---
> comments = blog:model "blog_comment"
90c90
< pages = blog:model "page"
---
> pages = blog:model "blog_page"

Still needed..

Sincerely
Journeyer



2015년 1월 17일 토요일 오전 12시 18분 42초 UTC+9, RJP Computing 님의 말:

Ryan Pusztai

unread,
Jan 20, 2015, 10:23:37 AM1/20/15
to Kepler Project mailing list
Hi Journeyer,

I went to add your changes and all of them are in git [1]. So I am not sure how you are getting the 'cvs-3' onto your machine but it should include those changes. Can you manually delete the samples directory and rerun 

$ luarocks --from=http://rocks.moonscript.org/dev install orbit cvs-3

Joh Journeyer J.

unread,
Jan 20, 2015, 7:10:22 PM1/20/15
to kepler-...@googlegroups.com
Hi Ryan,

From the github version of blog.lua, I still can find the same problems.

40c40
< posts = blog:model "post"
---
> posts = blog:model "blog_post"
77c77
< comments = blog:model "comment"
---
> comments = blog:model "blog_comment"
90c90
< pages = blog:model "page"
---
> pages = blog:model "blog_page"

On lines #40,#77,#90, there must be "blog_post", "blog_comment", "blog_page" rather than just "post", "comment", "page".

I did try reinstall orbit. Reinstalled blog.lua and the one in github still have these issues..

Am I wrong something?
Sincerely
Journeyer


2015년 1월 21일 수요일 오전 12시 23분 37초 UTC+9, RJP Computing 님의 말:

Joh Journeyer J.

unread,
Jan 20, 2015, 7:16:26 PM1/20/15
to kepler-...@googlegroups.com
Hi Ryan,

When I check the tables in blog.db, there shows only "blog_comment", "blog_page", "blog_post".

Either blog.db or blog.lua must be matched to the other..

Sincerely
Journeyer

2015년 1월 21일 수요일 오전 9시 10분 22초 UTC+9, Joh Journeyer J. 님의 말:
Reply all
Reply to author
Forward
0 new messages