Need to restart nodejs to see change in page.render()?

184 views
Skip to first unread message

ikeamanual

unread,
Nov 25, 2011, 10:41:31 AM11/25/11
to der...@googlegroups.com
Hi,

I am playing around and added a "data" key and {{data}} in the view.

page.render({
      room: room,
      randomUrl: parseInt(Math.random() * 1e9).toString(36),
data: 'okok'
});

But I needed to restart node to see the changes? Am I missing something?

I followed the instructions except for redis-scripting which gives me a link error on the math lib on my ubuntu 11.10, so I used redis-2.4.3

thanks,
Peter

istvanp

unread,
Nov 25, 2011, 6:24:27 PM11/25/11
to Derby
Peter,

From what I gather, using Redis 2.2.111 is mandatory. Racer probably
needs it even for the most basic commands like setNull. Good news is
that its going to come official in Redis 2.6. As or the linker error,
perhaps you should paste the error here so that someone can help.

Carl

unread,
Nov 26, 2011, 9:37:02 PM11/26/11
to Derby
I had the same error (included below) building redis-scripting on
ubuntu (11.10). Also tried the redis unstable branch thinking that
maybe that included the necessary scripting support (read it's coming
in 2.6 sometime this fall). It does build Lua as a dependency, but the
demos (todos, chat) didn't work - for example, I could not add a todo
item or chat message.
Maybe I should ask in another thread, but is there a list of future
plans? Any plans for authentication to be part of the framework or is
that something that a developer would bolt on themselves?
And congratulations. all this makes me feel like it's an exciting time
to be involved in web development.
Cheers,
Carl


cc -o redis-server -std=c99 -pedantic -O2 -Wall -W -lm -pthread -g
-rdynamic -ggdb adlist.o ae.o anet.o dict.o redis.o sds.o zmalloc.o
lzf_c.o lzf_d.o pqsort.o zipmap.o sha1.o ziplist.o release.o
networking.o util.o object.o db.o replication.o rdb.o t_string.o
t_list.o t_set.o t_zset.o t_hash.o config.o aof.o vm.o pubsub.o
multi.o debug.o sort.o intset.o syncio.o scripting.o ../deps/lua/src/
liblua.a
vm.o: In function `computeObjectSwappability':
/home/carl/src/redis-2.2.111-scripting/src/vm.c:446: undefined
reference to `log'
../deps/lua/src/liblua.a(lvm.o): In function `Arith':
lvm.c:(.text+0x485): undefined reference to `pow'
lvm.c:(.text+0x4b4): undefined reference to `floor'
../deps/lua/src/liblua.a(lvm.o): In function `luaV_execute':
lvm.c:(.text+0x22e1): undefined reference to `floor'
lvm.c:(.text+0x23fe): undefined reference to `pow'
../deps/lua/src/liblua.a(lcode.o): In function `codearith':
lcode.c:(.text+0x1168): undefined reference to `pow'
lcode.c:(.text+0x1190): undefined reference to `floor'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_tan':
lmathlib.c:(.text+0x9f): undefined reference to `tan'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_tanh':
lmathlib.c:(.text+0xcf): undefined reference to `tanh'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_sqrt':
lmathlib.c:(.text+0x11c): undefined reference to `sqrt'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_sin':
lmathlib.c:(.text+0x13f): undefined reference to `sin'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_sinh':
lmathlib.c:(.text+0x16f): undefined reference to `sinh'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_floor':
lmathlib.c:(.text+0x29f): undefined reference to `floor'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_random':
lmathlib.c:(.text+0x3be): undefined reference to `floor'
lmathlib.c:(.text+0x406): undefined reference to `floor'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_pow':
lmathlib.c:(.text+0x48a): undefined reference to `pow'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_log':
lmathlib.c:(.text+0x50f): undefined reference to `log'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_log10':
lmathlib.c:(.text+0x53f): undefined reference to `log10'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_fmod':
lmathlib.c:(.text+0x666): undefined reference to `fmod'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_exp':
lmathlib.c:(.text+0x67f): undefined reference to `exp'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_cos':
lmathlib.c:(.text+0x6af): undefined reference to `cos'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_cosh':
lmathlib.c:(.text+0x6df): undefined reference to `cosh'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_ceil':
lmathlib.c:(.text+0x70f): undefined reference to `ceil'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_atan':
lmathlib.c:(.text+0x73f): undefined reference to `atan'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_atan2':
lmathlib.c:(.text+0x78a): undefined reference to `atan2'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_asin':
lmathlib.c:(.text+0x7bf): undefined reference to `asin'
../deps/lua/src/liblua.a(lmathlib.o): In function `math_acos':
lmathlib.c:(.text+0x7ef): undefined reference to `acos'
collect2: ld returned 1 exit status
make[1]: *** [redis-server] Error 1
make[1]: Leaving directory `/home/carl/src/redis-2.2.111-scripting/
src'
make: *** [all] Error 2

Nate Smith

unread,
Nov 27, 2011, 8:14:11 PM11/27/11
to der...@googlegroups.com
Currently, you need to restart node every time you update any of the script files. This is because the server is running the same code as the client. You could use something like nodemon if you want the server to restart automatically whenever you save: https://github.com/remy/nodemon

In development, you shouldn't usually need to restart node if you only update a template or CSS file, since these are reloaded on every refresh. In production, you have to restart node whenever any file is changed, since Derby will cache templates.

- Nate

Nate Smith

unread,
Nov 27, 2011, 8:32:55 PM11/27/11
to der...@googlegroups.com
For now, the 2.2-scripting branch is the only one that is supported. I'll try and figure out why Racer isn't working with Redis unstable.

- Nate
Reply all
Reply to author
Forward
0 new messages