#493 √ hold
joel hansson

rake dm:db:database_yaml fails with error

Reported by joel hansson | September 23rd, 2008 @ 10:45 PM | in 0.9.8

I just installed merb+datamapper edge with thor. thor merb:edge:dm_more --install; etc..

i managed to merb-gen gottfolk, install merb-auth and install that slice. but now i'm stuck:

joel@chroma:~/public/gottfolk$ rake dm:db:database_yaml --trace
(in /home/joel/public/gottfolk)
 Invoke dm:db:database_yaml (first_time)
 Invoke dm:merb_start (first_time)
** Execute dm:merb_start
 ~ Loaded DEVELOPMENT Environment...
 ~ loading gem 'merb-slices' ...
 ~ loading gem 'merb-auth' ...
 ~ loading gem 'merb_datamapper' ...
 ~ loading gem 'dm-core' ...
 ~ loading gem 'merb-slices' ...
 ~ loading gem 'merb-auth' ...
 ~ loading gem 'merb_datamapper' ...
 ~ Merb::Orms::DataMapper::Connect block.
 ~ No database.yml file found in /home/joel/public/gottfolk/config, assuming database connection(s) established in the environment file in /home/joel/public/gottfolk/config/environments
 ~ Checking if we need to use DataMapper sessions
rake aborted!
undefined method root_behavior' for Merb::Router:Class
/usr/lib/ruby/gems/1.8/gems/merb_datamapper-0.9.8/lib/merb_datamapper.rb:30:inrun'
/usr/lib/ruby/gems/1.8/gems/merb-core-0.9.8/lib/merb-core/bootloader.rb:69:in run'
/usr/lib/ruby/gems/1.8/gems/merb-core-0.9.8/lib/merb-core/server.rb:57:instart'
/usr/lib/ruby/gems/1.8/gems/merb-core-0.9.8/lib/merb-core.rb:108:in start'
/usr/lib/ruby/gems/1.8/gems/merb-core-0.9.8/lib/merb-core.rb:119:instart_environment'
/usr/lib/ruby/gems/1.8/gems/merb_datamapper-0.9.8/lib/merb_datamapper/merbtasks.rb:7
/usr/lib/ruby/gems/1.8/gems/rake-0.8.2/lib/rake.rb:621:in call'
</pre>

Comments and changes to this ticket

  • Matt Aimonetti (mattetti)

    Matt Aimonetti (mattetti) September 23rd, 2008 @ 10:47 PM

    • → Milestone changed from “” to “0.9.8”
    • → State changed from “new” to “open”
    • → Assigned user changed from “” to “Carl Lerche”
  • joel hansson

    joel hansson September 23rd, 2008 @ 11:08 PM

    I did thor merb:edge:plugins --install

    first i got.

     ~ Checking if we need to use DataMapper sessions
     ~ Merb::Orms::DataMapper::Connect complete
     ~ WARNING: Merb.orm_generator_scope is deprecated
     ~ Loaded slice 'MerbAuth' ...
     ~ Compiling routes...
     ~ Mounting slice MerbAuth at /
     ~ Compiling routes...
     ~ Mounting slice MerbAuth at /
     ~ Could not load /home/joel/public/gottfolk/config/router.rb:
    
    undefined method `capture' for Merb::Router:Class - (NoMethodError)
    
    /usr/lib/ruby/gems/1.8/gems/merb-slices-0.9.8/lib/merb-slices/router_ext.rb:52:in `add_slice'
    /usr/lib/ruby/gems/1.8/gems/merb-core-0.9.8/lib/merb-core/dispatch/router/behavior.rb:55:in `send'
    /usr/lib/ruby/gems/1.8/gems/merb-core-0.9.8/lib/merb-core/dispatch/router/behavior.rb:55:in `method_missing'
    /home/joel/public/gottfolk/config/router.rb:28
    /usr/lib/ruby/gems/1.8/gems/merb-core-0.9.8/lib/merb-core/dispatch/router/behavior.rb:507:in `instance_eval'
    /usr/lib/ruby/gems/1.8/gems/merb-core-0.9.8/lib/merb-core/dispatch/router/behavior.rb:507:in `with_proxy'
    /usr/lib/ruby/gems/1.8/gems/merb-core-0.9.8/lib/merb-core/dispatch/router.rb:58:in `prepare'
    /home/joel/public/gottfolk/config/router.rb:23
    

    so i removed the merb-auth entry in config/router.rb (I'm following the guide at http://merbunity.com/tutorials/13 )

    it now created a config/database.yml.sample for me.

    I guess this ticket can be marked as invalid?

  • Carl Lerche

    Carl Lerche September 24th, 2008 @ 12:56 AM

    I have a feeling that it's a version mismatch between merb-core and merb-more that you have going on. Slices were updated for the latest API changes. Can you make sure that you have the latest merb-more or provide a failing spec.

  • Matt Aimonetti (mattetti)

    Matt Aimonetti (mattetti) September 24th, 2008 @ 09:02 AM

    • → State changed from “open” to “hold”
  • joel hansson

    joel hansson September 24th, 2008 @ 11:01 AM

    I just did a re-install of the merb and dm from latest git repositories. and i still get the "undefined method capture' - thingy. But that seems to be the

    r.add_slice(:MerbAuth, :path => "", :default_routes => false)

    in the config/router.rb files that I'm supposed to add, following the merb-auth tutorial over at http://merbunity.com/tutorials/13

    without that line, the config/database.yml.sample is created.

    Is the tutorial wrong when telling me to use the r.add_slice syntax for mounting the slice?

  • Michael Klishin (antares)

    Michael Klishin (antares) September 24th, 2008 @ 11:38 AM

    It uses old router code, new router requires no block variable. See this wiki page.

    So this causes exception on router file load and rake task fails. This is merb-auth problem, it's just outdated.

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »