move env check to railtie