lundi 14 septembre 2015

Railtie plugin cannot find "environment" task

Trying to create a Railtie gem, but running ...

$> rake environment

... returns the following ...

Don't know how to build task 'environment'

My Rakefile contains

require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new
Rake.add_rakelib 'lib/tasks'

I wanted to have the environment task to run some initializers that my custom rake tasks require (e.g. ActiveRecord.establish_connection).

I've tried requiring my Railtie class, and 'rails/tasks', in my Rakefile but no luck.

Any tips are appreciated - thanks!

Aucun commentaire:

Enregistrer un commentaire