[英]Use compass in gem for rails application
我正在嘗試創建一個代表JS和CSS庫的gem,並且可以將其包含在rails項目中(當前使用3.2)。 所有樣式表均以SASS編寫,並取決於指南針庫。
我嘗試將compass-rails
添加到“外部” gem的Gemfile中,並使用以下命令將其包括在gem SASS文件中
@import "compass"
但是,回到rails應用程序(與該gem相關),這會導致錯誤消息:
File to import not found or unreadable: compass.
難道我做錯了什么?
更新:如果我將gem compass-rails
Gemfile
gem compass-rails
添加到rails應用程序的Gemfile
,這似乎可以工作。 有任何解決方法嗎?
非常感謝你的幫助!
除了在寶石的Gemfile中添加指南針軌道外,還需要在某個地方require 'compass-rails'
,並將其添加到對我lib/your_gem_name.rb
的寶石內部的lib/your_gem_name.rb
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.