Remove -i flag from sudo. Use rvmsudo instead.