add debug info
porting for rails 3.2
add test env