我在预编译或推入heroku服务器时面临以下错误。
命令
RAILS_ENV=production rake assets:precompile --trace
错误
RAILS_ENV=production rake assets:precompile --trace
** Invoke assets:precompile (first_time)
** Invoke assets:environment (first_time)
** Execute assets:environment
** Invoke environment (first_time)
** Execute environment
** Execute assets:precompile
rake aborted!
NoMethodError: undefined method `[]' for nil:NilClass
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/sass_processor.rb:278:in `sprockets_context'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/sass_processor.rb:124:in `asset_path'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/sass_processor.rb:137:in `asset_url'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/sass_processor.rb:155:in `image_url'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/script/tree/funcall.rb:140:in `_perform'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/script/tree/node.rb:50:in `perform'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/script/tree/list_literal.rb:63:in `block in _perform'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/script/tree/list_literal.rb:63:in `map'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/script/tree/list_literal.rb:63:in `_perform'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/script/tree/node.rb:50:in `perform'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:395:in `visit_prop'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/stack.rb:79:in `block in with_base'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/stack.rb:115:in `with_frame'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/stack.rb:79:in `with_base'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:158:in `visit'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:431:in `block (2 levels) in visit_rule'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:431:in `map'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:431:in `block in visit_rule'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:179:in `with_environment'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:429:in `visit_rule'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/stack.rb:79:in `block in with_base'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/stack.rb:115:in `with_frame'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/stack.rb:79:in `with_base'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:158:in `visit'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:52:in `map'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:52:in `visit_children'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:167:in `block in visit_children'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:179:in `with_environment'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:166:in `visit_children'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:36:in `block in visit'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:186:in `visit_root'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:157:in `visit'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/visitors/perform.rb:8:in `visit'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/root_node.rb:36:in `css_tree'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/tree/root_node.rb:20:in `render'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sass-3.4.19/lib/sass/engine.rb:278:in `render'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/sass_compressor.rb:48:in `call'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/sass_compressor.rb:28:in `call'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:75:in `call_processor'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/processor_utils.rb:56:in `call_processors'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/loader.rb:60:in `block in load'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/loader.rb:318:in `fetch_asset_from_dependency_cache'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/loader.rb:44:in `load'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:47:in `yield'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/cached_environment.rb:47:in `load'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/base.rb:66:in `find_asset'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/manifest.rb:138:in `block in find'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:223:in `block in stat_tree'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:207:in `block in stat_directory'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:204:in `each'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:204:in `stat_directory'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/path_utils.rb:222:in `stat_tree'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:105:in `each'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:104:in `each'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/legacy.rb:104:in `logical_paths'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/manifest.rb:136:in `find'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/sprockets/manifest.rb:162:in `compile'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:70:in `block (3 levels) in define'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-3.4.0/lib/rake/sprocketstask.rb:147:in `with_logger'
/home/thamizh/.rvm/gems/ruby-2.2.1/gems/sprockets-rails-2.3.3/lib/sprockets/rails/task.rb:69:in `block (2 levels) in define'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:240:in `call'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:235:in `each'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/home/thamizh/.rvm/rubies/ruby-2.2.1/lib/ruby/gems/2.2.0/gems/rake-10.4.2/bin/rake:33:in `<top (required)>'
/home/thamizh/.rvm/gems/ruby-2.2.1/bin/rake:23:in `load'
/home/thamizh/.rvm/gems/ruby-2.2.1/bin/rake:23:in `<main>'
/home/thamizh/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
/home/thamizh/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => assets:precompile