Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6955257
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:42:47+00:00 2026-05-27T14:42:47+00:00

I have an existing Rails 3 application using ActiveRecord, and I want to switch

  • 0

I have an existing Rails 3 application using ActiveRecord, and I want to switch to Datamapper. The instructions given in the dm-rails page only talk about creating a new application. Does anyone know how to throw away all activerecord dependancies and migrate to datamapper?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T14:42:49+00:00Added an answer on May 27, 2026 at 2:42 pm

    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.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a new application starting that's using Rails 2.3.8 for stability concerns and
I have an existing Rails 3 application, to which I am adding a JSON
I have an existing rails application to which i am adding a new controller
I have an existing table that I'd like to use for a Rails application.
I'm new to Rails, but I have an existing Rails application for which I
After attempting to switch my Rails app to thin server using these instructions ,
I have an existing project written in Ruby on Rails. It is sort of
I'm building a Rails 3 application on CouchDB (using SimplyStored gem) and I'd like
I'm developing an application using rails 2.3.5, gitorious and deploy with vlad, the OS
I'm new to rails, and have taken some existing site for new enhancements. I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.