run as a ruby script

other minor changes:
manual bundle install
generating configuration
gsub_file