3

我正在尝试成功运行任务 rake assets:precompile 但出现以下错误

** Invoke assets:precompile (first_time)
** Execute assets:precompile
rake assets:precompile:all RAILS_ENV=production RAILS_GROUPS=assets --trace

** Invoke assets:precompile:all (first_time)
** Execute assets:precompile:all 
** Invoke assets:precompile:primary (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke tmp:cache:clear (first_time)
** Execute tmp:cache:clear
** Execute assets:precompile:primary
rake aborted!
stack level too deep
  (in .../app/assets/stylesheets/admin/scaffolds.css.scss)
.....rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/task.rb:162
Tasks: TOP => assets:precompile:primary
rake aborted!
Command failed with status (1): [/Users/diogui/.rvm/rubies/ruby-1.9.2-p320/...]
.....rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:53:in `block in create_shell_runner'
....rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `call'
....rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:45:in `sh'
....rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `sh'
....rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/file_utils.rb:80:in `ruby'
.....rvm/gems/ruby-1.9.2-p320@global/gems/rake-0.9.2.2/lib/rake/file_utils_ext.rb:39:in `ruby'
.....rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.1.1/lib/sprockets/assets.rake:9:in `ruby_rake_task'
....rvm/gems/ruby-1.9.2-p320/gems/actionpack-3.1.1/lib/sprockets/assets.rake:17:in    `    invoke_or_reboot_rake_task'

在我的 production.rb 我有

config.serve_static_assets = false
config.assets.enabled = true
config.assets.compress = true
config.assets.compile = true
config.assets.digest = true

是的,我有 Sass 3.1.4

group :assets do
  gem 'sass-rails',   '~> 3.1.4'
  gem 'coffee-rails', '~> 3.1.1'
  gem 'uglifier', '>= 1.0.3'
end

有人知道问题出在哪里吗?或者我错过了什么?谢谢 :)

4

2 回答 2

0

事实证明,这是 sass-rails gem 的一个记录问题:https ://github.com/rails/sass-rails/issues/78

显然可以通过将 sass-rails gem 降级到 3.1.4(如果您使用 Rails 3.1)或升级到 3.2.5(如果您使用 Rails 3.2)来解决:“rake aborted!stack level too deep”在部署到 Heroku 时

这对我有用:)

于 2013-01-23T20:34:19.653 回答
0

将 ruby​​ 版本更改为 2.3.0 就可以了。这个拯救了我的一天。

于 2017-04-06T12:04:26.920 回答