require 'erb' File.open(Rails.root.join('config/redis.conf.erb'), 'r') do |f| tmpl = ERB.new(f.read) File.open(Rails.root.join('config/redis.conf'), 'w') do |conf| conf.write(tmpl.result(binding)) end end