title: Rake tasks with Sinatra context on Heroku
body: <p>I have an app built on Sinatra. It's supported by several rake tasks that must be run to setup database, etc... The rakefile looks like this</p>
  
  <pre><code>require 'rubygems'
  require 'rake'
  require 'rake/clean'
  require 'rake/gempackagetask'
  require 'rake/rdoctask'
  require 'rake/testtask'
  require File.dirname(__FILE__) + '/lib/config.rb'
  require File.dirname(__FILE__) + '/lib/autoloads.rb'
  
  @db = Mongo::Connection.from_uri(settings.db_uri).db(settings.db_uri[Regexp.new('[^/]*$')])
  @cache = MemCache.new(settings.cache_server)
  </code></pre>
  
  <p>Works well on my development machine. Now, the problem is that after deployment to Heroku, the <code>settings</code> object becomes undefined, so every task fails. Do you have any idea how to solve this?</p>