Rails 3.1 engine migration does not work

I am creating a rails 3.1 engine with migrations. rake db: migration works fine inside this engine and inside the host application. But I need to include this engine in another rail engine. The second engine contains a dummy application for testing, I added this line to the application.rb of this dummy application:

require 'my_engine' 

In the console, I see classes from the first engine.

 rake -T 

give me the application: my_engine_engine: install: migrations task, but when I started this task

 rake app:my_engine_engine:install:migrations 

I get this error:

 rake aborted! Don't know how to build task 'railties:install:migrations' Tasks: TOP => app:my_engine_engine:install:migrations (See full trace by running task with --trace) 

Can someone help me with this problem?

+6
source share
2 answers

Well, I find a solution to my problem. I just needed to switch to my test application directory and run there:

 rake my_engine_engine:install:migrations 

and it works as it should.

+8
source

For rails3 you need cd /test/testapp , then rake community_engine:install:migrations

And it works!

+1
source

Source: https://habr.com/ru/post/895055/


All Articles