It's realtively straightforward, but there are a couple of things you need to do.
In your Gemfile, remove "rails" and instead require the following.
gem 'activesupport', RAILS_VERSION, :require => 'active_support'
gem 'actionpack', RAILS_VERSION, :require => 'action_pack'
gem 'actionmailer', RAILS_VERSION, :require => 'action_mailer'
gem 'railties', RAILS_VERSION, :require => 'rails'
Where RAILS_VERSION
is the version of Rails you want to use (e.g. ~> 3.1
). This is basically all of rails except ActiveRecord.
At the top of config/application.rb, remove the require for rails (I forget what the original require looks like) and replace it with specific requires for the railties you need.
require "action_controller/railtie"
require "action_mailer/railtie"
I think the only other one is a Test::Unit railtie, but we're not using Test::Unit, so we don't include it.
Finally, if you want to use the identity map (I suggest you do, but it's not needed), place in your ApplicationController's class body:
use Rails::DataMapper::Middleware::IdentityMap
That should be everything; the rest is just configuring your database.yml according to the README (it's pretty much cross-compatible with a standard rails one anyway).
For reference, take a look at what the generators does:
-zsh$ curl http://datamapper.org/templates/rails.rb
apply 'http://datamapper.org/templates/rails/gemfile.rb'
apply 'http://datamapper.org/templates/rails/application.rb'
If you look at the contents of those two files you'll see the extra stuff you'd get if you had used the generator.