1

我有一个应用程序正在使用舒适的墨西哥沙发(舒适)的叉子。我想将水银导轨安装到舒适的地方。这样做的原因是我可以修改 comfy 以使用汞。

我首先将引擎的 gem 添加到了舒适的 gemspec 中。

s.add_dependency 'mercury-rails'

跑了bundle install

然后继续安装指南,运行:

rails generate mercury:install

这给了我一个错误:

[WARNING] Could not load generator "generators/mercury/install/install_generator". Error: uninitialized constant Mercury::Engine.
/Users/DickieBoy/.rvm/gems/ruby-2.0.0-p247/gems/mercury-rails-0.3.1/lib/generators/mercury/install/install_generator.rb:4:in `<class:InstallGenerator>'
/Users/DickieBoy/.rvm/gems/ruby-2.0.0-p247/gems/mercury-rails-0.3.1/lib/generators/mercury/install/install_generator.rb:3:in `<module:Generators>'
/Users/DickieBoy/.rvm/gems/ruby-2.0.0-p247/gems/mercury-rails-0.3.1/lib/generators/mercury/install/install_generator.rb:2:in `<module:Mercury>'
/Users/DickieBoy/.rvm/gems/ruby-2.0.0-p247/gems/mercury-rails-0.3.1/lib/generators/mercury/install/install_generator.rb:1:in `<top (required)>'
/Users/DickieBoy/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/generators.rb:280:in `block (2 levels) in lookup'
/Users/DickieBoy/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/generators.rb:276:in `each'
/Users/DickieBoy/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/generators.rb:276:in `block in lookup'
/Users/DickieBoy/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/generators.rb:275:in `each'
/Users/DickieBoy/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/generators.rb:275:in `lookup'
/Users/DickieBoy/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/generators.rb:137:in `find_by_namespace'
/Users/DickieBoy/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/generators.rb:154:in `invoke'
/Users/DickieBoy/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/commands/generate.rb:11:in `<top (required)>'
/Users/DickieBoy/.rvm/gems/ruby-2.0.0-p247/gems/railties-4.0.1/lib/rails/commands.rb:48:in `<top (required)>'
bin/rails:4:in `require'
bin/rails:4:in `<main>'

现在我认为这是因为我试图将其安装在引擎而不是应用程序上。我猜引擎不是设计来做的。如果我尝试从应用程序中运行相同的命令,也会出现此错误。

请注意,当我将 gem 添加到标准 rails 应用程序时,此方法有效。

我的问题是:

是否有任何关于在发动机内安装发动机的标准/文件?

如果没有,我将如何去做?

4

1 回答 1

0

确保您的库也在此处定义:https ://github.com/comfy/comfortable-mexican-sofa/blob/master/lib/comfortable_mexican_sofa/engine.rb

于 2014-03-13T17:48:04.053 回答