Zhivko Draganov
Zhivko Draganov

Reputation: 1253

Running acts-as-taggable-on in engine

I'm trying to add acts-as-taggable-on gem as dependency into my mountable engine (which then is loaded into other application like gem).

Following the steps and adding it into engine.gemspec then running bundle install is fetching gem successfully, but when I try to execute rake acts_as_taggable_on_engine:install:migrations task, from engine or the app I receive the following message :

Don't know how to build task 'acts_as_taggable_on_engine:install:migrations'

Any ideas?

Upvotes: 1

Views: 924

Answers (1)

Andrew Feng
Andrew Feng

Reputation: 1970

Add "require 'acts-as-taggable-on'" to your engine file:

module YourEngine
  class Engine < ::Rails::Engine
    require 'acts-as-taggable-on'
    ...
  end
end

Then to see the rake tasks using "rake -T".

In my engine I am using "rake app:acts_as_taggable_on_engine:install:migrations". However, this will copy all migrations to my dummy app. What I did is manually moving that migrations from my dummy app to my engine, then run rake db:migrate.

Upvotes: 2

Related Questions