Get Gem vendor files in asset pipeline path

前端 未结 3 1950
故里飘歌
故里飘歌 2021-01-05 01:11

I have created a gem with a vendor directory containing stylesheets and javascripts from bootstrap-sass and bootstrap itself.

The directory structure is bootstrap-sa

相关标签:
3条回答
  • 2021-01-05 01:54

    The problem was with my require_paths variable. The correct setting should have been:

    s.require_paths = ["lib"]
    
    0 讨论(0)
  • 2021-01-05 02:07

    i think the asset pipeline expects your files to be named like bootstrap.css.scss. and I'm not sure, but maybe you need to define a railtie for your gem for rails to find the vendored stylesheets

    0 讨论(0)
  • 2021-01-05 02:16

    I had the same problem, I solved it adding a dummy engine. This way in rails 3.1 the assets path was added automatically to Rails.application.config.assets.paths.

    Since Rails 3.0, if you want a gem to automatically behave as an engine, you have to specify an Engine for it somewhere inside your plugin’s lib folder.

    0 讨论(0)
提交回复
热议问题