3

我一直在阅读快速启动 Rails 引擎教程

我正在尝试在刚刚生成的可安装 Rails 引擎中使用 rapidfire gem

rails plugin new blorgh --mountable

内部 blorgh.gemspec

我添加了

s.add_dependency "rapidfire"

然后进行捆绑安装

rapidfire 附带一些安装说明

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

bundle exec rails generate rapidfire:views

现在我只能在测试/虚拟应用程序中运行这些,因此迁移文件最终在虚拟应用程序中,而视图实际上最终在根应用程序中。我希望将速射安装在发动机上。Rapidfire 也是一个引擎。

我认为视图最终会出现在根应用程序中,因为它rails generate task and not a rake task

当我在 app 目录中尝试上面的 rake 任务时,我收到了这两个错误

/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'

有没有办法做到这一点?即使有解决方法,可能会出现哪些问题?

我在用rails 4.2

4

0 回答 0