Rails NoMethodError:未定义的方法`[]'为nil:NilClass错误,同时预生产用于生产

时间:2016-04-25 08:14:42

标签: ruby-on-rails asset-pipeline

我正在尝试使用

预编译资产以进行制作
RAILS_ENV=production rake assets:precompile --trace

但它给了我错误

NoMethodError: undefined method `[]' for nil:NilClass

完整的日志

/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/sass_processor.rb:278:in `sprockets_context'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/sass_processor.rb:124:in `asset_path'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/sass_processor.rb:200:in `font_path'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/script/tree/funcall.rb:140:in `_perform'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/script/tree/node.rb:50:in `perform'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/script/tree/funcall.rb:170:in `perform_arg'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/script/tree/funcall.rb:124:in `block in _perform'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/script/tree/funcall.rb:124:in `each'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/script/tree/funcall.rb:124:in `each_with_index'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/script/tree/funcall.rb:124:in `each'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/script/tree/funcall.rb:124:in `map'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/script/tree/funcall.rb:124:in `_perform'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/script/tree/node.rb:50:in `perform'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:395:in `visit_prop'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/stack.rb:79:in `block in with_base'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/stack.rb:115:in `with_frame'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/stack.rb:79:in `with_base'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:158:in `visit'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:502:in `block (2 levels) in visit_directive'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:502:in `map'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:502:in `block in visit_directive'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:179:in `with_environment'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:501:in `visit_directive'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:158:in `block in visit'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/stack.rb:79:in `block in with_base'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/stack.rb:115:in `with_frame'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/stack.rb:79:in `with_base'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:158:in `visit'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/base.rb:52:in `map'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/base.rb:52:in `visit_children'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:167:in `block in visit_children'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:179:in `with_environment'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:166:in `visit_children'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/base.rb:36:in `block in visit'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:186:in `visit_root'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/base.rb:36:in `visit'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:157:in `visit'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/visitors/perform.rb:8:in `visit'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/root_node.rb:36:in `css_tree'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/tree/root_node.rb:20:in `render'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sass-3.4.21/lib/sass/engine.rb:278:in `render'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/sass_compressor.rb:48:in `call'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/sass_compressor.rb:28:in `call'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:75:in `call_processor'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/processor_utils.rb:56:in `call_processors'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/loader.rb:60:in `block in load'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/loader.rb:318:in `fetch_asset_from_dependency_cache'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/loader.rb:44:in `load'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/cached_environment.rb:47:in `yield'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/cached_environment.rb:47:in `load'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/base.rb:66:in `find_asset'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/base.rb:73:in `find_all_linked_assets'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/manifest.rb:142:in `block in find'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:225:in `block in stat_tree'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:209:in `block in stat_directory'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:206:in `each'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:206:in `stat_directory'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:224:in `stat_tree'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:228:in `block in stat_tree'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:209:in `block in stat_directory'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:206:in `each'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:206:in `stat_directory'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/path_utils.rb:224:in `stat_tree'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/legacy.rb:105:in `each'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/legacy.rb:105:in `block in logical_paths'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/legacy.rb:104:in `each'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/legacy.rb:104:in `logical_paths'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/manifest.rb:140:in `find'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/sprockets/manifest.rb:168:in `compile'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-rails-3.0.4/lib/sprockets/rails/task.rb:68:in `block (3 levels) in define'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-3.5.2/lib/rake/sprocketstask.rb:147:in `with_logger'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/sprockets-rails-3.0.4/lib/sprockets/rails/task.rb:67:in `block (2 levels) in define'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/task.rb:240:in `call'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/task.rb:240:in `block in execute'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/task.rb:235:in `each'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/task.rb:235:in `execute'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/faisal/.rvm/rubies/ruby-2.2.3/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/task.rb:165:in `invoke'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/application.rb:150:in `invoke_task'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/application.rb:106:in `each'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/application.rb:106:in `block in top_level'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/application.rb:115:in `run_with_threads'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/application.rb:100:in `top_level'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/application.rb:78:in `block in run'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/application.rb:176:in `standard_exception_handling'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/lib/rake/application.rb:75:in `run'
/home/faisal/.rvm/gems/ruby-2.2.3/gems/rake-10.5.0/bin/rake:33:in `<top (required)>'
/home/faisal/.rvm/gems/ruby-2.2.3/bin/rake:23:in `load'
/home/faisal/.rvm/gems/ruby-2.2.3/bin/rake:23:in `<main>'
/home/faisal/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `eval'
/home/faisal/.rvm/gems/ruby-2.2.3/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => assets:precompile

我试图在过去4天内解决这个问题 尝试了几乎所有类似问题的答案。 我甚至删除了除application.js / css之外的所有.css和.js文件,但结果是一样的。

可能是它的实际问题 但结果仍然相同

0 个答案:

没有答案