我正在尝试运行任务rake资产:预编译,但我有以下错误
** 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'
在我的produ.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
有人知道这是什么问题吗?或者我错过了什么?谢谢:))
答案 0 :(得分: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" while deploying to Heroku < / p>
这对我有用:)
答案 1 :(得分:0)
将ruby版本更改为2.3.0就可以了。 这个节省了我的一天。