module SitemapGenerator
  class Railtie < Rails::Railtie
    rake_tasks do
      require File.expand_path('../tasks', __FILE__)
    end
  end
end

module SitemapGenerator
  class Railtie < Rails::Railtie
    rake_tasks do
      load "tasks/sitemap_generator_tasks.rake"
    end
  end
end

Load the rake task instead of requiring them
Load the rake task instead of requiring them

Based on http://edgeapi.rubyonrails.org/classes/Rails/Railtie.html#class-Rails::Railtie-label-Loading+rake+tasks+and+generators