简体   繁体   中英

Rails 3.1 engine rake db:test:prepare task missing

I'm working on a rails 3.1 engine, and as it's a brand new release and I'm working off of edge, I didn't expect things to go perfectly. I can't seem to get my engine to see the db:test:prepare task when I run bundle exec rake -T

I'm using rake 0.8.7 and edge rails. If I try to require the dummy application's Rakefile, I get

undefined method 'prerequisites' for nil:NilClass on line 7 of spec/dummy/Rakefile

Line 7 of my Rakefile in spec/dummy/ is Dummy::Application.load_tasks

My research so far has brought me to http://www.engineyard.com/blog/2010/rails-3-beta-is-out-a-retrospective/ which corresponds with databases.rake in Active Record.

How do I get the db:test:prepare task into my engine?

我认为你必须以app为前缀,所以rake app:db:test:prepare ,或者只是rake app:test:prepare

Looks like http://blog.davidchelimsky.net/2011/05/22/rspec-rails-261beta1-is-released/ is the answer.

The reason being is that it guards against calling prerequisites on nil and will work with Rails 3.1 RC (or edge at this moment in time).

据我所知,它只是被称为rake测试:在rails 3.1中准备

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM