fixed issue #48, use proper exit code on error

Could you touch this up and check the actual output returned is correct, eg the message about installing the gem.