{"action":"created","issue":{"url":"https://api.github.com/repos/ruby-grape/grape/issues/1151","labels_url":"https://api.github.com/repos/ruby-grape/grape/issues/1151/labels{/name}","comments_url":"https://api.github.com/repos/ruby-grape/grape/issues/1151/comments","events_url":"https://api.github.com/repos/ruby-grape/grape/issues/1151/events","html_url":"https://github.com/ruby-grape/grape/issues/1151","id":106116275,"number":1151,"title":"Error with rack-mount and rails 4.2.4","user":{"login":"brauliobo","id":41740,"avatar_url":"https://avatars.githubusercontent.com/u/41740?v=3","gravatar_id":"","url":"https://api.github.com/users/brauliobo","html_url":"https://github.com/brauliobo","followers_url":"https://api.github.com/users/brauliobo/followers","following_url":"https://api.github.com/users/brauliobo/following{/other_user}","gists_url":"https://api.github.com/users/brauliobo/gists{/gist_id}","starred_url":"https://api.github.com/users/brauliobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brauliobo/subscriptions","organizations_url":"https://api.github.com/users/brauliobo/orgs","repos_url":"https://api.github.com/users/brauliobo/repos","events_url":"https://api.github.com/users/brauliobo/events{/privacy}","received_events_url":"https://api.github.com/users/brauliobo/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ruby-grape/grape/labels/bug?","name":"bug?","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":7,"created_at":"2015-09-12T00:28:46Z","updated_at":"2015-09-13T13:34:16Z","closed_at":null,"body":"The following error happens only with rails 4.2.4 (and rack 1.6) and not on rails 3.2.22 (and rack 1.4):\r\n```\r\nERROR[\"test_should_suggest_event_children\", ArticlesTest, 2015-09-10 18:40:02 -0300]\r\n test_should_suggest_event_children#ArticlesTest (1441921202.61s)\r\nNoMethodError:         NoMethodError: undefined method `[]' for nil:NilClass\r\n            /home/braulio/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:155:in `block in call'\r\n            /home/braulio/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:96:in `block in recognize'\r\n            /home/braulio/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:68:in `optimized_each'\r\n            /home/braulio/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-mount-0.8.3/lib/rack/mount/code_generation.rb:95:in `recognize'\r\n            /home/braulio/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-mount-0.8.3/lib/rack/mount/route_set.rb:141:in `call'\r\n            /home/braulio/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/grape-0.13.0/lib/grape/api.rb:114:in `call'\r\n            /home/braulio/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/grape-0.13.0/lib/grape/api.rb:44:in `call!'\r\n            /home/braulio/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/grape-0.13.0/lib/grape/api.rb:39:in `call'\r\n            /home/braulio/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-test-0.6.3/lib/rack/mock_session.rb:30:in `request'\r\n            /home/braulio/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-test-0.6.3/lib/rack/test.rb:244:in `process_request'\r\n            /home/braulio/.rbenv/versions/2.2.3/lib/ruby/gems/2.2.0/gems/rack-test-0.6.3/lib/rack/test.rb:67:in `post'\r\n            test/unit/api/articles_test.rb:366:in `block in <class:ArticlesTest>'\r\n```\r\n\r\nThe error happened because `rack-mount` is expecting the result of rack call to be an array, but it is a hash (file `rack-mount-0.8.3/lib/rack/mount/route_set.rb`):\r\n```ruby\r\n151             \r\n152         result = route.app.call(env) \r\n153             \r\n154         pp result\r\n155         if result[1][X_CASCADE] == PASS\r\n156           env[@parameters_key] = old_params\r\n157         else\r\n158           return res\r\n```\r\n\r\nIt seems that `rack-mount` is unmaintained for a long time (even the repo was deleted). Have you considered to not depend on it anymore?\r\n\r\ncc @diguliu @terceiro"},"comment":{"url":"https://api.github.com/repos/ruby-grape/grape/issues/comments/139874245","html_url":"https://github.com/ruby-grape/grape/issues/1151#issuecomment-139874245","issue_url":"https://api.github.com/repos/ruby-grape/grape/issues/1151","id":139874245,"user":{"login":"brauliobo","id":41740,"avatar_url":"https://avatars.githubusercontent.com/u/41740?v=3","gravatar_id":"","url":"https://api.github.com/users/brauliobo","html_url":"https://github.com/brauliobo","followers_url":"https://api.github.com/users/brauliobo/followers","following_url":"https://api.github.com/users/brauliobo/following{/other_user}","gists_url":"https://api.github.com/users/brauliobo/gists{/gist_id}","starred_url":"https://api.github.com/users/brauliobo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brauliobo/subscriptions","organizations_url":"https://api.github.com/users/brauliobo/orgs","repos_url":"https://api.github.com/users/brauliobo/repos","events_url":"https://api.github.com/users/brauliobo/events{/privacy}","received_events_url":"https://api.github.com/users/brauliobo/received_events","type":"User","site_admin":false},"created_at":"2015-09-13T13:34:16Z","updated_at":"2015-09-13T13:34:16Z","body":"@dblock it didn't happen on rails 3.2, so maybe it is a new way rails4.2/rack1.6 is issueing exceptions"}}