我在(Rails.root/lib/tasks/me.rake)的rails应用程序中有以下内容:
task :abc do
puts "here is abc"
end
并且可以致电:
rake abc # works
但以下不起作用:
irb> rake :abc # doesn't work
bash>rake -T # doesn't show up
也不:
describe 'query task061', task061:true do
it 'should query' do
FactoryGirl.create(:location2)
Q.count.should == 1
rake['abc'].invoke
end
end
我还需要做什么才能允许以这些方式调用任务?
谢谢