2012-03-19 89 views
18

我的網站曾經是工作和Heroku預編譯的資產和一切。現在,看似無處,我開始上部署此消息:「Rake aborted!stack level too deep」,同時部署到Heroku

Preparing app for Rails asset pipeline 
Running: rake assets:precompile 
mkdir -p /tmp/build_31cexir1p9pwn/public/assets 
mkdir -p /tmp/build_31cexir1p9pwn/public/assets/icons 
mkdir -p /tmp/build_31cexir1p9pwn/public/assets/icons 
mkdir -p /tmp/build_31cexir1p9pwn/public/assets 
mkdir -p /tmp/build_31cexir1p9pwn/public/assets 
(in /tmp/build_31cexir1p9pwn) 
mkdir -p /tmp/build_31cexir1p9pwn/public/assets 
mkdir -p /tmp/build_31cexir1p9pwn/public/assets 
rake aborted! 
stack level too deep 
(in /tmp/build_31cexir1p9pwn/app/assets/stylesheets/theme.css.scss) 

(See full trace by running task with --trace) 
Precompiling assets failed, enabling runtime asset compilation 
Injecting rails31_enable_runtime_asset_compilation 

它不能預編譯我的CSS文件。

我使用雪松堆棧,這是我的Gemfile:

gem 'rails', '3.1.0' 
gem 'rake', '0.8.7' 
gem 'devise' 

group :production do 
    gem 'pg' 
    gem 'thin' 
end 

group :assets do 
    gem 'sass-rails', " ~> 3.1.0" 
    gem 'coffee-rails', "~> 3.1.0" 
    gem 'uglifier' 
end 

這裏是我的application.rb中文件

# Enable the asset pipeline 
config.assets.enabled = true 

# Version of your assets, change this if you want to expire all your assets. 
config.assets.version = '1.0' 

這是我的production.rb文件

# Code is not reloaded between requests 
config.cache_classes = true 

# Full error reports are disabled and caching is turned on 
config.consider_all_requests_local  = false 
config.action_controller.perform_caching = true 

# Enable Rails's static asset server (Apache or nginx will not need this) 
config.serve_static_assets = true 

# Set expire header of 30 days for static files 
config.static_cache_control = "public, max-age=2592000" 

# Allow JavaScript and CSS compression 
config.assets.compress = true 

# Compress JavaScript by removing whitespace, shortening variable names, ... 
config.assets.js_compressor = :uglifier 

# Don't fallback to assets pipeline if a precompiled asset is missed 
config.assets.compile = true 

現在我所有的圖像鏈接都被打破了(我在我的css文件中使用了image-url())。可能是什麼問題,我該如何解決?

+0

你能列出這個文件,theme.css.scss。它似乎與您的資產管道溢出 – 2012-03-20 00:35:18

+1

「堆棧級別過深」錯誤實際上是應用程序內存不足的情況。這通常是程序使用大量遞歸(自我調用的函數)的結果,並且像解析器(SASS到CSS,CoffeeScript到JS,ERB到HTML)等通常會使用遞歸。作爲解決方法,嘗試在部署之前預先編譯資源 - 您的本地計算機上的內存可能會比Heroku實例多。 – 2012-03-20 01:05:14

+0

這是一個非常嚴重的錯誤。你有沒有在github上報告過? – jcollum 2012-04-24 05:56:47

回答

30

我真的很絕望,所以我asked another question。顯然這是由sass和降級引起的sass-rails v3.1.4 v3.2.5會使其工作。

+0

這也適用於我。我有點懷疑,這已經是一個長期的問題,而sass-rails大師仍然會導致這個問題。希望我知道什麼系列的事件導致它: - \ – 2012-07-15 01:03:05

0

降級到SASS-軌v3.1.4爲我工作:)

0

升級到SASS v3.2.12的伎倆,我

但總體而言,它看起來像問題被固定在當前所有版本,只是做一個包更新,你應該很好。

1

對於ruby 2.3.0或更低版本,在application.rb文件中有以下行。但2.4.0或更高版本已經實現了自動化。

Bundler.require(*Rails.groups)

改變紅寶石版本2.3.0的伎倆。這一次拯救了我的一天。