zedshaw/Tir — Issue #11: Tir complaining about json
Author: martletandco
Created: 2012-01-17 01:27:44+00:00
State: open

Going through the Arc Challenge example, after starting Mongrel2, 'tir start' gives:

```Started app/arc_challenge.lua PID 6621
lua: /usr/share/lua/5.1//json/util.lua:149: variable 'json' is not declared
stack traceback:
[C]: in function 'error'
/usr/share/lua/5.1//tir/strict.lua:37: in function
/usr/share/lua/5.1//json/util.lua:149: in main chunk
[C]: in function 'require'
/usr/share/lua/5.1//json/decode.lua:10: in main chunk
[C]: in function 'require'
/usr/share/lua/5.1//json.lua:5: in main chunk
[C]: in function 'require'
/usr/share/lua/5.1//tir/util.lua:5: in main chunk
[C]: in function 'require'
/usr/share/lua/5.1//tir/engine.lua:12: in main chunk
[C]: in function 'require'
app/arc_challenge.lua:1: in main chunk
[C]: ?
CHILD DIED app/arc_challenge.lua PID 6621:	exited
SCRIPT app/arc_challenge.lua RESTARTING TOO FAST. Pausing while you fix stuff.```

It seems Tir doesn't get anywhere as the traceback shows it chokes after loading a few files.
I'm not sure what is causing the issue as LuaRocks installed json with a problem. The following code runs fine:

```require 'json'
val = {'A', 'B', 'C'}
val_json = json.encode( val )
val_unjson = json.decode( val_json )
print( val_json )
print( val_unjson[1] )```

Any help would be fantastic.