{"action":"created","issue":{"url":"https://api.github.com/repos/summernote/summernote-rails/issues/46","repository_url":"https://api.github.com/repos/summernote/summernote-rails","labels_url":"https://api.github.com/repos/summernote/summernote-rails/issues/46/labels{/name}","comments_url":"https://api.github.com/repos/summernote/summernote-rails/issues/46/comments","events_url":"https://api.github.com/repos/summernote/summernote-rails/issues/46/events","html_url":"https://github.com/summernote/summernote-rails/issues/46","id":136475688,"number":46,"title":"summernote-rails 0.8.1.1 breaks test environment with error: undefined method `[]' for nil:NilClass","user":{"login":"mattbrictson","id":189693,"avatar_url":"https://avatars.githubusercontent.com/u/189693?v=3","gravatar_id":"","url":"https://api.github.com/users/mattbrictson","html_url":"https://github.com/mattbrictson","followers_url":"https://api.github.com/users/mattbrictson/followers","following_url":"https://api.github.com/users/mattbrictson/following{/other_user}","gists_url":"https://api.github.com/users/mattbrictson/gists{/gist_id}","starred_url":"https://api.github.com/users/mattbrictson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattbrictson/subscriptions","organizations_url":"https://api.github.com/users/mattbrictson/orgs","repos_url":"https://api.github.com/users/mattbrictson/repos","events_url":"https://api.github.com/users/mattbrictson/events{/privacy}","received_events_url":"https://api.github.com/users/mattbrictson/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2016-02-25T18:49:05Z","updated_at":"2016-02-25T19:32:17Z","closed_at":"2016-02-25T19:32:17Z","body":"Hi, I just upgraded from summernote-rails 0.7.1.0 to 0.8.1.1 and my capybara tests are now all failing. I am just digging into this now and will try to build a more concise failure case, but perhaps someone watching these issues has encountered the same problem and has some ideas?\r\n\r\nHere is the error:\r\n\r\n```\r\nActionView::Template::Error: undefined method `[]' for nil:NilClass\r\nsprockets-3.5.2/lib/sprockets/sass_processor.rb:278:in `sprockets_context'\r\n```\r\n\r\n**Removing `//= require summernote` from my `application.css.scss` fixes the problem.** Downgrading to summernote-rails 0.7.1.0 also fixes it.\r\n\r\nThe failing code in `sprockets-3.5.2/lib/sprockets/sass_processor.rb` is:\r\n\r\n```ruby\r\ndef sprockets_context\r\n  options[:sprockets][:context] # Fails here\r\nend\r\n```\r\n\r\nUsing pry I discovered that `options` has no key named `:sprockets`, and so `options[:sprockets]` is nil, leading to the error.\r\n\r\nI am using Rails 4.2.5.1, sprockets 3.5.2, sprockets-rails 3.0.2, and summernote-rails 0.8.1.1.\r\n\r\nHere is a more complete backtrace:\r\n\r\n```\r\nsprockets-3.5.2/lib/sprockets/sass_processor.rb:280:in `sprockets_context'\r\nsprockets-3.5.2/lib/sprockets/sass_processor.rb:124:in `asset_path'\r\nsprockets-3.5.2/lib/sprockets/sass_processor.rb:200:in `font_path'\r\nsass-3.4.21/lib/sass/script/tree/funcall.rb:140:in `_perform'\r\nsass-3.4.21/lib/sass/script/tree/node.rb:50:in `perform'\r\nsass-3.4.21/lib/sass/script/tree/funcall.rb:170:in `perform_arg'\r\nsass-3.4.21/lib/sass/script/tree/funcall.rb:124:in `block in _perform'\r\nsass-3.4.21/lib/sass/script/tree/funcall.rb:124:in `each'\r\nsass-3.4.21/lib/sass/script/tree/funcall.rb:124:in `each_with_index'\r\nsass-3.4.21/lib/sass/script/tree/funcall.rb:124:in `each'\r\nsass-3.4.21/lib/sass/script/tree/funcall.rb:124:in `map'\r\nsass-3.4.21/lib/sass/script/tree/funcall.rb:124:in `_perform'\r\nsass-3.4.21/lib/sass/script/tree/node.rb:50:in `perform'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:395:in `visit_prop'\r\nsass-3.4.21/lib/sass/tree/visitors/base.rb:36:in `visit'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:158:in `block in visit'\r\nsass-3.4.21/lib/sass/stack.rb:79:in `block in with_base'\r\nsass-3.4.21/lib/sass/stack.rb:115:in `with_frame'\r\nsass-3.4.21/lib/sass/stack.rb:79:in `with_base'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:158:in `visit'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:502:in `block (2 levels) in visit_directive'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:502:in `map'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:502:in `block in visit_directive'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:179:in `with_environment'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:501:in `visit_directive'\r\nsass-3.4.21/lib/sass/tree/visitors/base.rb:36:in `visit'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:158:in `block in visit'\r\nsass-3.4.21/lib/sass/stack.rb:79:in `block in with_base'\r\nsass-3.4.21/lib/sass/stack.rb:115:in `with_frame'\r\nsass-3.4.21/lib/sass/stack.rb:79:in `with_base'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:158:in `visit'\r\nsass-3.4.21/lib/sass/tree/visitors/base.rb:52:in `block in visit_children'\r\nsass-3.4.21/lib/sass/tree/visitors/base.rb:52:in `map'\r\nsass-3.4.21/lib/sass/tree/visitors/base.rb:52:in `visit_children'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:167:in `block in visit_children'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:179:in `with_environment'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:166:in `visit_children'\r\nsass-3.4.21/lib/sass/tree/visitors/base.rb:36:in `block in visit'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:186:in `visit_root'\r\nsass-3.4.21/lib/sass/tree/visitors/base.rb:36:in `visit'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:157:in `visit'\r\nsass-3.4.21/lib/sass/tree/visitors/perform.rb:8:in `visit'\r\nsass-3.4.21/lib/sass/tree/root_node.rb:36:in `css_tree'\r\nsass-3.4.21/lib/sass/tree/root_node.rb:20:in `render'\r\nsass-3.4.21/lib/sass/engine.rb:278:in `render'\r\nsprockets-3.5.2/lib/sprockets/sass_compressor.rb:48:in `call'\r\nsprockets-3.5.2/lib/sprockets/sass_compressor.rb:28:in `call'\r\nsprockets-3.5.2/lib/sprockets/processor_utils.rb:75:in `call_processor'\r\nsprockets-3.5.2/lib/sprockets/processor_utils.rb:57:in `block in call_processors'\r\nsprockets-3.5.2/lib/sprockets/processor_utils.rb:56:in `reverse_each'\r\nsprockets-3.5.2/lib/sprockets/processor_utils.rb:56:in `call_processors'\r\nsprockets-3.5.2/lib/sprockets/loader.rb:134:in `load_from_unloaded'\r\nsprockets-3.5.2/lib/sprockets/loader.rb:60:in `block in load'\r\nsprockets-3.5.2/lib/sprockets/loader.rb:318:in `fetch_asset_from_dependency_cache'\r\nsprockets-3.5.2/lib/sprockets/loader.rb:44:in `load'\r\nsprockets-3.5.2/lib/sprockets/cached_environment.rb:20:in `block in initialize'\r\nsprockets-3.5.2/lib/sprockets/cached_environment.rb:47:in `load'\r\nsprockets-3.5.2/lib/sprockets/base.rb:66:in `find_asset'\r\nsprockets-3.5.2/lib/sprockets/base.rb:73:in `find_all_linked_assets'\r\nsprockets-3.5.2/lib/sprockets/manifest.rb:142:in `block in find'\r\nsprockets-3.5.2/lib/sprockets/legacy.rb:114:in `block (2 levels) in logical_paths'\r\nsprockets-3.5.2/lib/sprockets/path_utils.rb:225:in `block in stat_tree'\r\nsprockets-3.5.2/lib/sprockets/path_utils.rb:209:in `block in stat_directory'\r\nsprockets-3.5.2/lib/sprockets/path_utils.rb:206:in `each'\r\nsprockets-3.5.2/lib/sprockets/path_utils.rb:206:in `stat_directory'\r\nsprockets-3.5.2/lib/sprockets/path_utils.rb:224:in `stat_tree'\r\nsprockets-3.5.2/lib/sprockets/legacy.rb:105:in `each'\r\nsprockets-3.5.2/lib/sprockets/legacy.rb:105:in `block in logical_paths'\r\nsprockets-3.5.2/lib/sprockets/legacy.rb:104:in `each'\r\nsprockets-3.5.2/lib/sprockets/legacy.rb:104:in `logical_paths'\r\nsprockets-3.5.2/lib/sprockets/manifest.rb:140:in `find'\r\nsprockets-rails-3.0.2/lib/sprockets/railtie.rb:41:in `each'\r\nsprockets-rails-3.0.2/lib/sprockets/railtie.rb:41:in `map'\r\nsprockets-rails-3.0.2/lib/sprockets/railtie.rb:41:in `precompiled_assets'\r\nsprockets-rails-3.0.2/lib/sprockets/railtie.rb:34:in `asset_precompiled?'\r\nsprockets-rails-3.0.2/lib/sprockets/railtie.rb:205:in `block (3 levels) in <class:Railtie>'\r\nsprockets-rails-3.0.2/lib/sprockets/rails/helper.rb:346:in `precompiled?'\r\nsprockets-rails-3.0.2/lib/sprockets/rails/helper.rb:350:in `raise_unless_precompiled_asset'\r\nsprockets-rails-3.0.2/lib/sprockets/rails/helper.rb:324:in `digest_path'\r\nsprockets-rails-3.0.2/lib/sprockets/rails/helper.rb:312:in `asset_path'\r\nsprockets-rails-3.0.2/lib/sprockets/rails/helper.rb:90:in `block in resolve_asset_path'\r\nsprockets-rails-3.0.2/lib/sprockets/rails/helper.rb:230:in `block in resolve_asset'\r\nsprockets-rails-3.0.2/lib/sprockets/rails/helper.rb:229:in `each'\r\nsprockets-rails-3.0.2/lib/sprockets/rails/helper.rb:229:in `detect'\r\nsprockets-rails-3.0.2/lib/sprockets/rails/helper.rb:229:in `resolve_asset'\r\nsprockets-rails-3.0.2/lib/sprockets/rails/helper.rb:89:in `resolve_asset_path'\r\nsprockets-rails-3.0.2/lib/sprockets/rails/helper.rb:79:in `compute_asset_path'\r\nactionview-4.2.5.1/lib/action_view/helpers/asset_url_helper.rb:135:in `asset_path'\r\nactionview-4.2.5.1/lib/action_view/helpers/asset_url_helper.rb:267:in `stylesheet_path'\r\nactionview-4.2.5.1/lib/action_view/helpers/asset_tag_helper.rb:100:in `block in stylesheet_link_tag'\r\nactionview-4.2.5.1/lib/action_view/helpers/asset_tag_helper.rb:96:in `map'\r\nactionview-4.2.5.1/lib/action_view/helpers/asset_tag_helper.rb:96:in `stylesheet_link_tag'\r\nsprockets-rails-3.0.2/lib/sprockets/rails/helper.rb:173:in `block in stylesheet_link_tag'\r\nsprockets-rails-3.0.2/lib/sprockets/rails/helper.rb:171:in `map'\r\nsprockets-rails-3.0.2/lib/sprockets/rails/helper.rb:171:in `stylesheet_link_tag'\r\n```"},"comment":{"url":"https://api.github.com/repos/summernote/summernote-rails/issues/comments/188943347","html_url":"https://github.com/summernote/summernote-rails/issues/46#issuecomment-188943347","issue_url":"https://api.github.com/repos/summernote/summernote-rails/issues/46","id":188943347,"user":{"login":"mattbrictson","id":189693,"avatar_url":"https://avatars.githubusercontent.com/u/189693?v=3","gravatar_id":"","url":"https://api.github.com/users/mattbrictson","html_url":"https://github.com/mattbrictson","followers_url":"https://api.github.com/users/mattbrictson/followers","following_url":"https://api.github.com/users/mattbrictson/following{/other_user}","gists_url":"https://api.github.com/users/mattbrictson/gists{/gist_id}","starred_url":"https://api.github.com/users/mattbrictson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattbrictson/subscriptions","organizations_url":"https://api.github.com/users/mattbrictson/orgs","repos_url":"https://api.github.com/users/mattbrictson/repos","events_url":"https://api.github.com/users/mattbrictson/events{/privacy}","received_events_url":"https://api.github.com/users/mattbrictson/received_events","type":"User","site_admin":false},"created_at":"2016-02-25T19:32:17Z","updated_at":"2016-02-25T19:32:17Z","body":"OK, it looks like if I use `@import \"summernote\"` instead of the Sprockets-style manifest `//= require summernote`, then the problem goes away."}}