Try to fix libv8 error in post install script.

Also move gem install commands so that they will be processed before gem bundle commands.  Make gem update run as git user instead of root.