Jngai1297
Jngai1297

Reputation: 2495

mounting a rails engine gem inside a mountable rails engine rake tasks

I have been going through the quick start rails engine tutorial

I am trying to use rapidfire gem inside a mountable rails engine just generated

rails plugin new blorgh --mountable

inside blorgh.gemspec

I added

s.add_dependency "rapidfire"

and then do a bundle install

rapidfire comes with some installation instructions

bundle install
bundle exec rake rapidfire:install:migrations
bundle exec rake db:migrate

bundle exec rails generate rapidfire:views

now I can only run these inside the test/dummy app so the migration files end up in the dummy app and the views actually end up in the root app. I want rapidfire to be mounted on the engine. Rapidfire is an engine too.

I think the views end up in the root app because its rails generate task and not a rake task

When I try the rake tasks above inside the app directory I am getting these two errors

/railties-4.2.0/lib/rails/tasks/statistics.rake:4: warning: already initialized constant STATS_DIRECTORIES

railties-4.2.0/lib/rails/tasks/statistics.rake:4: warning: previous definition of STATS_DIRECTORIES was here
rake aborted!
Don't know how to build task 'rapidfire:install:migrations'

Is there a way to achieve this? What are some possible problems even if there is a work around?

I am using rails 4.2

Upvotes: 3

Views: 256

Answers (0)

Related Questions