簡體   English   中英

compass-rails不讓我做@import指南針/重置

[英]compass-rails isn't letting me do @import compass/reset

我啟動應用程序時遇到此錯誤:

File to import not found or unreadable: compass/reset.
Load path: /Users/nbenes/projects/lawgical_admin
  (in /Users/nbenes/projects/lawgical_admin/app/assets/stylesheets/screen.css.sass)

(堆棧跟蹤:)

app/assets/stylesheets/screen.css.sass:2
app/views/layouts/login.html.haml:7:in `_app_views_layouts_login_html_haml__1550030126632827390_2194381580'

引發錯誤的文件如下所示:

app/assets/screen.css.sass

// This import applies a global reset to any page that imports this stylesheet.
@import compass/reset

它正在崩潰的import線上,我不知道如何讓它看到羅盤寶石。

我的gemfile有這個:

Gemfile

group :assets do
  gem 'sass-rails', '~> 3.2.3'
  gem 'coffee-rails', '~> 3.2.1'
  gem 'uglifier', '>= 1.0.3'
  gem 'compass-rails'
end

指南針配置是准系統:

config/compass.rb

# Require any additional compass plugins here.
project_type = :rails

最后,樣式表被拉入視圖:

app/views/layouts/login.html.haml

= stylesheet_link_tag 'screen', :media => 'screen, projection'

不知怎的,它只是沒有看到指南針或導入它。 我嘗試跳過compass/reset導入,但后來它在@import blueprint消失了

對於某些上下文,我正在將此應用程序升級到rails 3.2並使用資產管道而不是Jammit來編譯資產(Jammit gem和配置文件已被刪除)。 知道出了什么問題嗎? :(

原來我錯過了從Rails 3.0.x升級到Rails 3.2.x時config/application.rb一個非常小但非常重要的變化

在rails 3中有一行內容如下:

Bundler.require(:default, Rails.env) if defined?(Bundler)

我沒能升級到如下內容:

if defined?(Bundler)
  # If you precompile assets before deploying to production, use this line
  Bundler.require(*Rails.groups(:assets => %w(development test)))
  # If you want your assets lazily compiled in production, use this line
  # Bundler.require(:default, :assets, Rails.env)   
end

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM