Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8504377
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T02:00:49+00:00 2026-06-11T02:00:49+00:00

We are creating several applications (new development) at our company. To try and establish

  • 0

We are creating several applications (new development) at our company. To try and establish a common look and feel between these apps I would like to create a gem that:

  • Incorporates specific versions of gems like bootstrap-sass
  • Declares several common CSS styles, using mixins from bootstrap where appropriate
  • Provides other assets as well.

I want the applications that we develop to merely have to include my common-ui gem, they should not include things like bootstrap directly.

The pattern for exposing scss from a gem is pretty straight forward (just take a look at the bootstrap-sass project); where things get interesting is when my scss needs to access bootstrap. When an application includes my scss, the pipeline complains that it cannot locate bootstrap and everything comes to a halt.

What is the best approach to creating a gem that does what I have described?

============================================================================

To better follow SO’s format, I am going to answer my question with what I came up with (and why I think it works). I am somewhat new to rails, so my answer is by no means authoritative. Feel free to comment or propose a better way of doing things.

============================================================================

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T02:00:51+00:00Added an answer on June 11, 2026 at 2:00 am

    See caveat in the question, this may be a spectacularly bad way to solve this problem

    Here’s what’s working so far. For a gem to expose assets to an application’s asset pipeline, it must be initialized as an engine. The problem with one gem using another’s assets is that the other gem’s engine may not have been initialized and therefore the pipeline doesn’t know about the other gems assets.

    To work around this, just require the root file from the other gem in your root file. So in lib/company-common-ui.rb, I have the following:

    require "company-common-ui/version"
    
    module Company
      module Common
        module Ui
          # We don't really need anything here
        end
      end
    end
    
    require "company-common-ui/engine"
    require "bootstrap-sass"
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm creating new application using zend framework with several modules. Can you please advice
When creating a new Rails application, it is automatically supplied with several quite large
I'm in the progress of creating an upgrade path for our application and several
I have several questions regarding CI application design. Q. When creating a new form
I'm creating several menu items programmatically like this : NSMenuItem* newItem = [[NSMenuItem alloc]
I'm creating several visual objects in loop: ... Package packet; // a visual packet
I just finished creating several models and a had to separately write all of
using c# (asp.net) i'm programmatically creating several drop down lists (random number). the user
In my program, I am creating several threads in the main() method. The last
I am creating an array from several text boxes. I am needing to move

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.