Add support to switch ruby with main function