I think I've finally got DataMapper and do_mysql installed on ubuntu 8.04
server. I am not using Rails at this point, just trying to get DataMapper
to work.
Trying to follow the example at datamapper.org, I wrote this script:
* **#!/usr/bin/env ruby*
*
*
* **require 'rubygems'*
* **require 'dm-core'*
*
*
* **# If you want the logs displayed you have to do this before the call to
setup*
* **DataMapper::Logger.new($stdout, :debug)*
*
*
* **# I can open the database with cmd: $ mysql -h localhost -u dmapper
-pdmapper dmapper_development*
* **DataMapper.setup(:testing, {*
* **:adapter => 'mysql',*
* **:host => 'localhost',*
* **:username => 'dmapper',*
* **:password => 'dmapper',*
* **:database => 'dmapper_development'})*
*
*
* **class Post*
* **include DataMapper::Resource*
*
*
* **property :id, Serial # An auto-increment integer key*
* **property :title, String # A varchar type string, for short
strings*
* **property :body, Text # A text block, for longer string data.*
* **property :created_at, DateTime # A DateTime, for any date you might
like.*
* **end*
*
*
* **DataMapper.auto_migrate!*
When the last statement is reached, it gives the error:
/usr/local/lib/ruby/gems/1.9.1/gems/dm-core-0.10.2/lib/dm-core/repository.rb:69:in
`adapter': Adapter not set: default. Did you forget to setup?
(DataMapper::RepositoryNotSetupError)
from
/usr/local/lib/ruby/gems/1.9.1/gems/dm-core-0.10.2/lib/dm-core/migrations.rb:1316:in
`destroy_model_storage'
from
/usr/local/lib/ruby/gems/1.9.1/gems/dm-core-0.10.2/lib/dm-core/migrations.rb:1390:in
`auto_migrate_down!'
from
/usr/local/lib/ruby/gems/1.9.1/gems/dm-core-0.10.2/lib/dm-core/migrations.rb:45:in
`block in repository_execute'
from
/usr/local/lib/ruby/gems/1.9.1/gems/dm-core-0.10.2/lib/dm-core/model/descendant_set.rb:33:in
`block in each'
from
/usr/local/lib/ruby/gems/1.9.1/gems/dm-core-0.10.2/lib/dm-core/model/descendant_set.rb:33:in
`each'
from
/usr/local/lib/ruby/gems/1.9.1/gems/dm-core-0.10.2/lib/dm-core/model/descendant_set.rb:33:in
`each'
from
/usr/local/lib/ruby/gems/1.9.1/gems/dm-core-0.10.2/lib/dm-core/migrations.rb:44:in
`repository_execute'
from
/usr/local/lib/ruby/gems/1.9.1/gems/dm-core-0.10.2/lib/dm-core/migrations.rb:34:in
`auto_migrate_down!'
from
/usr/local/lib/ruby/gems/1.9.1/gems/dm-core-0.10.2/lib/dm-core/migrations.rb:21:in
`auto_migrate!'
from ./dm_tester.rb:28:in `<main>'
I'd appreciate any guidance to fixing this. How can I be sure I've
installed do_mysql? (I added "require 'do_mysql'" to the script but that
didn't change anything.)
Thanks,
ge (Chapel Hill, NC)
--
Besta é tu se você não viver nesse mundo
http://zabouti.tumblr.com
http://claimid.com/zabouti
--
You received this message because you are subscribed to the Google Groups
"DataMapper" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/datamapper?hl=en.