Rails Engine - Gems dependencies, how to load them into the application?

后端 未结 7 1068
Happy的楠姐
Happy的楠姐 2020-11-30 01:23

I\'m doing an engine here, it works alright in stand alone.

When I transform it into a gem, and load it inside another application, I get a lot of undefined errors,

7条回答
  •  悲&欢浪女
    2020-11-30 02:07

    You can include all gems for the environment with a simple bundler command:

    Bundler.require(*Rails.groups)
    

    You could add this to an config/initializer.

提交回复
热议问题