2013-12-14 68 views
13

我嘗試啓用chrome源地圖後,從heroku收到以下警告http://blog.vhyza.eu/blog/2013/09/22/debugging-rails-4-coffeescript-and-sass-source-files-in-google-chrome/ 它們表示什麼,以及應該更改哪些內容?heroku上的Rails應用程序出現sass錯誤:無法轉儲匿名類

我的Gemfile:

source 'https://rubygems.org' 
ruby '2.0.0' 

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' 
gem 'rails', '4.0.0' 

# Use sqlite3 as the database for Active Record 
#gem 'sqlite3' 
gem 'pg' 
gem 'devise' 
gem 'font-awesome-rails' 
gem 'bootstrap-sass', github: 'thomas-mcdonald/bootstrap-sass' 
gem 'simple_form', git: 'https://github.com/plataformatec/simple_form.git' 
gem 'carrierwave' 
gem 'fog', '~> 1.3.1' 
gem 'mini_magick' 
gem 'rails_12factor' 
gem 'friendly_id', '~> 5.0.0' 

# Use SCSS for stylesheets 
gem 'sass-rails', '~> 4.0.0' 
gem 'bourbon' 

group :development do 
    gem 'sass-rails-source-maps' 
end 

# Use Uglifier as compressor for JavaScript assets 
gem 'uglifier', '>= 1.3.0' 

# Use CoffeeScript for .js.coffee assets and views 
gem 'coffee-rails', '~> 4.0.0' 

# See https://github.com/sstephenson/execjs#readme for more supported runtimes 
# gem 'therubyracer', platforms: :ruby 

# Use jquery as the JavaScript library 
gem 'jquery-rails', '~> 3.0' 

# Turbolinks makes following links in your web application faster. Read more: https://github.com/rails/turbolinks 
# gem 'turbolinks' 

# Build JSON APIs with ease. Read more: https://github.com/rails/jbuilder 
gem 'jbuilder', '~> 1.2' 

group :doc do 
    # bundle exec rake doc:rails generates the API under doc/api. 
    gem 'sdoc', require: false 
end 

# Use ActiveModel has_secure_password 
# gem 'bcrypt-ruby', '~> 3.0.0' 

# Use unicorn as the app server 
# gem 'unicorn' 

# Use Capistrano for deployment 
# gem 'capistrano', group: :development 

# Use debugger 
# 

我的錯誤日誌:

 Running: rake assets:precompile 
     Warning. Error encountered while saving cache caaf9b127eacbc8d55c6b0df080ed0d983d6c0ac/application.css.scssc: can't dump anonymous class #<Class:0x007f9af404e7a0> 
     Warning. Error encountered while saving cache 29b09f293164ce1d09e4f27743f6d079f2f4f07e/_bourbon.scssc: can't dump anonymous class #<Class:0x007f9af404e7a0> 
     Warning. Error encountered while saving cache f432cc7b803f4c796599d16a379d862748156dd8/_deprecated-webkit-gradient.scssc: can't dump anonymous class #<Class:0x007f9af404e7a0> 

... ...修剪

 Warning. Error encountered while saving cache 1a45a1496fb361a3cf719ffc3cecf01b3639f108/_clearfix.scssc: can't dump anonymous class #<Class:0x007f9af404e7a0> 
     Warning. Error encountered while saving cache 1a45a1496fb361a3cf719ffc3cecf01b3639f108/_font-family.scssc: can't dump anonymous class #<Class:0x007f9af404e7a0> 
     Warning. Error encountered while saving cache 1a45a1496fb361a3cf719ffc3cecf01b3639f108/_hide-text.scssc: can't dump anonymous class #<Class:0x007f9af404e7a0> 
     Warning. Error encountered while saving cache 1a45a1496fb361a3cf719ffc3cecf01b3639f108/_html5-input-types.scssc: can't dump anonymous class #<Class:0x007f9af404e7a0> 
     DEPRECATION WARNING on line 25 of /tmp/build_502e235d-b5cc-428d-b0dc-0ba968b29b22/vendor/bundle/ruby/2.0.0/gems/bourbon-3.1.8/app/assets/stylesheets/addons/_html5-input-types.scss: 
     Assigning to global variable "$unquoted-inputs-list" by default is deprecated. 
     In future versions of Sass, this will create a new local variable. 
     If you want to assign to the global variable, use "$unquoted-inputs-list: append($unquoted-inputs-list, unquote($input-type), comma) !global" instead. 
     DEPRECATION WARNING on line 25 of /tmp/build_502e235d-b5cc-428d-b0dc-0ba968b29b22/vendor/bundle/ruby/2.0.0/gems/bourbon-3.1.8/app/assets/stylesheets/addons/_html5-input-types.scss: 
     Assigning to global variable "$unquoted-inputs-list" by default is deprecated. 
     In future versions of Sass, this will create a new local variable. 
     If you want to assign to the global variable, use "$unquoted-inputs-list: append($unquoted-inputs-list, unquote($input-type), comma) !global" instead. 
     DEPRECATION WARNING on line 25 of /tmp/build_502e235d-b5cc-428d-b0dc-0ba968b29b22/vendor/bundle/ruby/2.0.0/gems/bourbon-3.1.8/app/assets/stylesheets/addons/_html5-input-types.scss: 
     Assigning to global variable "$unquoted-inputs-list" by default is deprecated. 
     In future versions of Sass, this will create a new local variable. 
     If you want to assign to the global variable, use "$unquoted-inputs-list: append($unquoted-inputs-list, unquote($input-type), comma) !global" instead. 

... ...修剪

 DEPRECATION WARNING on line 44 of /tmp/build_502e235d-b5cc-428d-b0dc-0ba968b29b22/vendor/bundle/ruby/2.0.0/gems/bourbon-3.1.8/app/assets/stylesheets/addons/_html5-input-types.scss: 
     Assigning to global variable "$all-text-inputs-focus" by default is deprecated. 
     In future versions of Sass, this will create a new local variable. 
     If you want to assign to the global variable, use "$all-text-inputs-focus: append($all-text-inputs-focus, $input-type-focus, comma) !global" instead. 
     DEPRECATION WARNING on line 44 of /tmp/build_502e235d-b5cc-428d-b0dc-0ba968b29b22/vendor/bundle/ruby/2.0.0/gems/bourbon-3.1.8/app/assets/stylesheets/addons/_html5-input-types.scss: 
     Assigning to global variable "$all-text-inputs-focus" by default is deprecated. 
     In future versions of Sass, this will create a new local variable. 
     If you want to assign to the global variable, use "$all-text-inputs-focus: append($all-text-inputs-focus, $input-type-focus, comma) !global" instead. 
     DEPRECATION WARNING on line 44 of /tmp/build_502e235d-b5cc-428d-b0dc-0ba968b29b22/vendor/bundle/ruby/2.0.0/gems/bourbon-3.1.8/app/assets/stylesheets/addons/_html5-input-types.scss: 
     Assigning to global variable "$all-text-inputs-focus" by default is deprecated. 
     In future versions of Sass, this will create a new local variable. 
     If you want to assign to the global variable, use "$all-text-inputs-focus: append($all-text-inputs-focus, $input-type-focus, comma) !global" instead. 
     Warning. Error encountered while saving cache 1a45a1496fb361a3cf719ffc3cecf01b3639f108/_position.scssc: can't dump anonymous class #<Class:0x007f9af404e7a0> 
     Warning. Error encountered while saving cache 1a45a1496fb361a3cf719ffc3cecf01b3639f108/_prefixer.scssc: can't dump anonymous class #<Class:0x007f9af404e7a0> 
     Warning. Error encountered while saving cache 1a45a1496fb361a3cf719ffc3cecf01b3639f108/_retina-image.scssc: can't dump anonymous class #<Class:0x007f9af404e7a0> 

... ...修剪

 Warning. Error encountered while saving cache caaf9b127eacbc8d55c6b0df080ed0d983d6c0ac/users.css.scssc: can't dump anonymous class #<Class:0x007f9af404e7a0> 
     Warning. Error encountered while saving cache 46ee9071a8688db94b0b5f37c155438469009e50/font-awesome.css.erbc: can't dump anonymous class #<Class:0x007f9af404e7a0> 
     Warning. Error encountered while saving cache caaf9b127eacbc8d55c6b0df080ed0d983d6c0ac/comments.css.scssc: can't dump anonymous class #<Class:0x007f9af404e7a0> 
     I, [2013-12-14T02:00:10.168503 #765] INFO -- : Writing /tmp/build_502e235d-b5cc-428d-b0dc-0ba968b29b22/public/assets/application-26c0def79d3f5f44f52eb91252ea1cc5.css 
     Asset precompilation completed (20.56s) 
+0

也許你的sass寶石是在alpha版本,嘗試降級到穩定版本,參考這裏:https://github.com/middleman/middleman/issues/716 –

+0

@Taiki源地圖不在穩定版本薩斯,你必須運行一個邊緣/ alpha版本才能得到它們。 – cimmanon

+0

嘿哈利,你有沒有得到這個解決我今天有類似的問題。 – AndyM

回答

3

我發現問題是這在我的ENV文件。

config.cache_store = :dalli_store 

我知道這是需要幫助加快編制,但我可以沒有它現在直到我發現後發現瞭如何解決它正確的事情。

+2

其他人想要跟隨這個錯誤,看看票[1093](https://github.com/nex3/sass/issues/1093)&[1028](https://github.com/nex3/sass/issues/1028) – lightswitch05

15

我能夠通過降級我的sass gem(這是由sass-rails引入的)來解決此問題。

我的Gemfile現在包含:

gem "sass", "~> 3.2.5" 
gem 'sass-rails' 
+2

顯然sass 3.3.0(也可能是底層的鏈輪包)導致此問題:請參閱http://stackoverflow.com/a/22287503/550712。在我的Rails 3.2.16項目中,我能夠通過sass-rails 3.2.6使用最新的sass <3.3.0(當前爲3.2.19)來清理資源以預編譯。 –

+0

這也適用於我(Rails 3.2.18,sass-rails 3.2.6,sass 3.2.19)。 –

3

我有同樣的問題在寫這篇文章的時間,但後來我用sass-rails 5.0.0.beta1,但我確認,而不是降級,你可以升級到最新的sass-rails 5.0.0一切都會好的。升級到最新版本而不是降級。

+0

非常感謝,沒有人提到這一點。我在看我的sass寶石,顯然不是3.2(根據github有問題) – Scientist1642

相關問題