部署到Heroku时,“rake aborted!stack level too deep”

时间:2012-03-19 23:31:28

标签: ruby-on-rails ruby-on-rails-3 heroku devise cedar

我的网站曾经在工作,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文件。

我正在使用雪松堆栈,这是我的宝石文件:

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())。可能是什么问题,我该如何解决?

3 个答案:

答案 0 :(得分:30)

我非常绝望,所以我asked another question。显然这是由sass和降级到sass-rails引起的 v3.1.4 v3.2.5会使它工作。

答案 1 :(得分:1)

升级到sass v3.2.12为我做了诀窍

但总体而言,看起来问题已在所有当前版本上得到修复,只需进行捆绑更新即可。您应该做得很好。

答案 2 :(得分:1)

对于ruby 2.3.0或更低版本,在Rails的 application.rb 文件中包含以下行。但2.4.0或更高版本已将这些实现为自动化。

var video = document.getElementById("myVideo"); video.onseeked = function() { if (video.currentTime <= 2) video.currentTime = 0; };

将ruby版本更改为2.3.0就可以了。这个节省了我的一天。