Dynamic robots.txt for different Rails environments with Rack.
Add gem to your Gemfile
gem 'robotron'
Bundle it
bundle install
Add to your config/routes.rb
Rails.application.routes.draw do
get '/robots.txt' => Robotron
end
Create config/robots.txt for production