Added rails build support, use 'grunt build --rails' or 'grunt dist --rails'.