#!/usr/bin/env ruby root = "#{__dir__}/.." app_root = "#{root}/dummy-app" unless File.exist? "#{app_root}/bin/rails" warn 'Creating the dummy-app app...' Dir.chdir root do system "#{root}/bin/dummy-app" or begin warn 'Automatic creation of the dummy-app app failed' exit 1 end end end Dir.chdir app_root exec "#{app_root}/bin/rails", *ARGV