如何将依赖项添加到Rails Engine的虚拟应用程序中?
我想在测试/虚拟应用程序中添加一些依赖项,以便可以对引擎进行集成测试。我添加了一个测试/虚拟/gemfile,并将依赖项放在上面:
gem 'devise'
gem 'devise_invitable'
在测试/虚拟中运行捆绑包后,创建了测试/虚拟/gemfile.lock。
但是,当我运行Rails G设计:安装在测试/虚拟中时,它说
method_missing': undefined method `active_storage' for #<Rails::Application::Configuration:0x00007fad8f2a0dc0> (NoMethodError)
我如何能够在虚拟应用程序中添加依赖关系? 我可以使它工作的唯一方法是将其添加到引擎宝石的依赖项中。但是我宁愿不这样做
:我可以在gemfile中添加导轨,并且可以运行安装,但是在进行测试后,它会有此错误:
test/dummy/config/initializers/devise.rb:11:in `<top (required)>': uninitialized constant Devise (NameError)
I would like to add a few dependencies in my test/dummy app so that I can do integration test of my engine. I added a test/dummy/Gemfile and put the dependencies on it:
gem 'devise'
gem 'devise_invitable'
after I run bundle install inside the test/dummy, the test/dummy/Gemfile.lock is created.
but when I run rails g devise:install inside the test/dummy, it says
method_missing': undefined method `active_storage' for #<Rails::Application::Configuration:0x00007fad8f2a0dc0> (NoMethodError)
How am I able to add dependencies to the dummy app?
The only way I can get it to work is if I add it to the dependencies of my engine gem. but I prefer not to do that
EDIT: I added rails in my Gemfile and devise install can be run, but after I run my test, it has this error:
test/dummy/config/initializers/devise.rb:11:in `<top (required)>': uninitialized constant Devise (NameError)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论