I’ve tried to take a look to DataMapper with Rails 3, so I follow this
simple instruction on GitHub - datamapper/dm-rails: Integrate DataMapper with Rails 3.
$ rails new testing_dm3 -m http://datamapper.org/templates/rails.rb
$ cd testing_dm3
$ bundle install
$ rails g scaffold Person name:string
$ rake db:setup
/Users/jm/.rvm/gems/ruby-head@rails3dm/gems/rake-0.8.7/lib/rake/alt_system.rb:32:
Use RbConfig instead of obsolete and deprecated Config.
(in /Users/jm/dev/personal/testing_dm3)
[datamapper] Created database ‘testing_dm3_development.db’
[datamapper] Created database ‘testing_dm3_test.db’
[datamapper] Finished auto_migrate! for :default repository
‘testing_dm3_development.db’
$ thin start (I like thin)
Go to http://0.0.0.0:3000/people and you should see
DataObjects::SyntaxError in People#index
no such table: people
If you don’t, you are lucky. I fixed this modifying database.yml:
change “database” to “path”
database: testing_dm3_development.db
to
path: ./db/testing_dm3_development.db
and run:
$ rake db:setup (again)
That fixed it for me. That happend because the database is in_memory and
doesn’t create the files, if you run the migration on a rails console,
inside the console you can CRUD your objects, but when you left the
session you lost the data.