Devise: SyntaxError in sessions_controller.rb in Ruby 2.5.0-preview1

Created on 7 Dec 2017  ·  3Comments  ·  Source: heartcombo/devise

Environment

  • Ruby 2.5.0-preview1
  • Rails 5.1.4
  • Devise 4.3.0

Current behavior

On Ruby 2.5.0, devise throws a SyntaxError from sessions_controller.rb:

::1 - - [06/Dec/2017:20:15:08 PST] "GET /sign_out HTTP/1.1" 302 102
http://localhost:3000/onboarding -> /sign_out
[2017-12-06 20:15:08.293 INFO ] Started GET "/sign_out_oauth" for ::1 at 2017-12-06 20:15:08 -0800
[2017-12-06 20:15:08.705 FATAL] 
[2017-12-06 20:15:08.705 FATAL] SyntaxError (/home/sage/.rbenv/versions/2.5.0-preview1/lib/ruby/gems/2.5.0/gems/devise-4.3.0/app/controllers/devise/sessions_controller.rb:5: syntax error, unexpected '{', expecting keyword_end
...ion only: [:create, :destroy] { request.env["devise.skip_tim...
...                              ^
/home/sage/.rbenv/versions/2.5.0-preview1/lib/ruby/gems/2.5.0/gems/devise-4.3.0/app/controllers/devise/sessions_controller.rb:5: syntax error, unexpected '}', expecting keyword_end
..."devise.skip_timeout"] = true }
...                              ^):
[2017-12-06 20:15:08.705 FATAL] 
[2017-12-06 20:15:08.705 FATAL] devise (4.3.0) app/controllers/devise/sessions_controller.rb:5: syntax error, unexpected '{', expecting keyword_end
...ion only: [:create, :destroy] { request.env["devise.skip_tim...
...                              ^
devise (4.3.0) app/controllers/devise/sessions_controller.rb:5: syntax error, unexpected '}', expecting keyword_end
..."devise.skip_timeout"] = true }
...                              ^
bootsnap (1.1.5) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:63:in `load'
bootsnap (1.1.5) lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:63:in `load'
zeus (0.15.14) lib/zeus/load_tracking.rb:82:in `load'
activesupport (5.1.4) lib/active_support/dependencies.rb:476:in `block in load_file'
activesupport (5.1.4) lib/active_support/dependencies.rb:661:in `new_constants_in'
activesupport (5.1.4) lib/active_support/dependencies.rb:475:in `load_file'
activesupport (5.1.4) lib/active_support/dependencies.rb:374:in `block in require_or_load'
activesupport (5.1.4) lib/active_support/dependencies.rb:36:in `block in load_interlock'
activesupport (5.1.4) lib/active_support/dependencies/interlock.rb:12:in `block in loading'
activesupport (5.1.4) lib/active_support/concurrency/share_lock.rb:149:in `exclusive'
activesupport (5.1.4) lib/active_support/dependencies/interlock.rb:11:in `loading'
activesupport (5.1.4) lib/active_support/dependencies.rb:36:in `load_interlock'
activesupport (5.1.4) lib/active_support/dependencies.rb:357:in `require_or_load'
activesupport (5.1.4) lib/active_support/dependencies.rb:510:in `load_missing_constant'
bootsnap (1.1.5) lib/bootsnap/load_path_cache/core_ext/active_support.rb:43:in `load_missing_constant'
activesupport (5.1.4) lib/active_support/dependencies.rb:202:in `const_missing'
activesupport (5.1.4) lib/active_support/inflector/methods.rb:271:in `const_get'
activesupport (5.1.4) lib/active_support/inflector/methods.rb:271:in `block in constantize'
activesupport (5.1.4) lib/active_support/inflector/methods.rb:267:in `each'
activesupport (5.1.4) lib/active_support/inflector/methods.rb:267:in `inject'
activesupport (5.1.4) lib/active_support/inflector/methods.rb:267:in `constantize'
activesupport (5.1.4) lib/active_support/dependencies.rb:582:in `get'
activesupport (5.1.4) lib/active_support/dependencies.rb:613:in `constantize'
actionpack (5.1.4) lib/action_dispatch/http/request.rb:85:in `controller_class_for'
actionpack (5.1.4) lib/action_dispatch/http/parameters.rb:99:in `binary_params_for?'
actionpack (5.1.4) lib/action_dispatch/http/parameters.rb:90:in `set_binary_encoding'
actionpack (5.1.4) lib/action_dispatch/http/parameters.rb:67:in `path_parameters='
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:48:in `block in serve'
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:33:in `each'
actionpack (5.1.4) lib/action_dispatch/journey/router.rb:33:in `serve'
actionpack (5.1.4) lib/action_dispatch/routing/route_set.rb:834:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
omniauth (1.7.1) lib/omniauth/strategy.rb:190:in `call!'
omniauth (1.7.1) lib/omniauth/strategy.rb:168:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
omniauth (1.7.1) lib/omniauth/strategy.rb:190:in `call!'
omniauth (1.7.1) lib/omniauth/strategy.rb:168:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
http_accept_language (2.1.1) lib/http_accept_language/middleware.rb:14:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/rack/agent_hooks.rb:30:in `traced_call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/rack/browser_monitoring.rb:32:in `traced_call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
i18n-js (3.0.2) lib/i18n/js/middleware.rb:14:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
i18n-js (3.0.2) lib/i18n/js/middleware.rb:14:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
warden (1.2.7) lib/warden/manager.rb:36:in `block in call'
warden (1.2.7) lib/warden/manager.rb:35:in `catch'
warden (1.2.7) lib/warden/manager.rb:35:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/etag.rb:25:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/conditional_get.rb:25:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/head.rb:12:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/session/abstract/id.rb:232:in `context'
rack (2.0.3) lib/rack/session/abstract/id.rb:226:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/cookies.rb:613:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
activerecord (5.1.4) lib/active_record/migration.rb:556:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/callbacks.rb:26:in `block in call'
activesupport (5.1.4) lib/active_support/callbacks.rb:97:in `run_callbacks'
actionpack (5.1.4) lib/action_dispatch/middleware/callbacks.rb:24:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/executor.rb:12:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/debug_exceptions.rb:59:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/show_exceptions.rb:31:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
railties (5.1.4) lib/rails/rack/logger.rb:36:in `call_app'
railties (5.1.4) lib/rails/rack/logger.rb:24:in `block in call'
activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `block in tagged'
activesupport (5.1.4) lib/active_support/tagged_logging.rb:26:in `tagged'
activesupport (5.1.4) lib/active_support/tagged_logging.rb:69:in `tagged'
railties (5.1.4) lib/rails/rack/logger.rb:24:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/remote_ip.rb:79:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
request_store (1.3.2) lib/request_store/middleware.rb:9:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/request_id.rb:25:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/method_override.rb:22:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/runtime.rb:22:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
activesupport (5.1.4) lib/active_support/cache/strategy/local_cache_middleware.rb:27:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/executor.rb:12:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
actionpack (5.1.4) lib/action_dispatch/middleware/static.rb:125:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/sendfile.rb:111:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
sentry-raven (2.7.1) lib/raven/integrations/rack.rb:51:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
railties (5.1.4) lib/rails/engine.rb:522:in `call'
newrelic_rpm (4.6.0.338) lib/new_relic/agent/instrumentation/middleware_tracing.rb:92:in `call'
rack (2.0.3) lib/rack/handler/webrick.rb:86:in `service'
/home/sage/.rbenv/versions/2.5.0-preview1/lib/ruby/2.5.0/webrick/httpserver.rb:140:in `service'
/home/sage/.rbenv/versions/2.5.0-preview1/lib/ruby/2.5.0/webrick/httpserver.rb:96:in `run'
/home/sage/.rbenv/versions/2.5.0-preview1/lib/ruby/2.5.0/webrick/server.rb:288:in `block in start_thread'
[2017-12-06 20:15:08.706 INFO ] Processing by ErrorsController#internal_server_error as HTML
[2017-12-06 20:15:08.708 DEBUG] User Load (0.3ms)  SELECT  `users`.* FROM `users` WHERE `users`.`id` = 21515199 ORDER BY `users`.`id` ASC LIMIT 1
[2017-12-06 20:15:08.709 INFO ] Redirected to http://localhost:3000/onboarding?return_to=%2F500
[2017-12-06 20:15:08.709 INFO ] Filter chain halted as :check_onboarded rendered or redirected
[2017-12-06 20:15:08.710 INFO ] Completed 302 Found in 3ms (ActiveRecord: 0.3ms)
::1 - - [06/Dec/2017:20:15:08 PST] "GET /sign_out_oauth HTTP/1.1" 302 115
http://localhost:3000/onboarding -> /sign_out_oauth
[2017-12-06 20:15:08.764 INFO ] Started GET "/onboarding?return_to=%2F500" for ::1 at 2017-12-06 20:15:08 -0800
[2017-12-06 20:15:08.774 INFO ] Processing by OnboardingController#index as HTML
[2017-12-06 20:15:08.774 INFO ] Parameters: {"return_to"=>"/500"}
[2017-12-06 20:15:08.776 DEBUG] User Load (0.2ms)  SELECT  `users`.* FROM `users` WHERE `users`.`id` = 21515199 ORDER BY `users`.`id` ASC LIMIT 1
[2017-12-06 20:15:08.778 INFO ] Rendering onboarding/index.html.haml within layouts/onboarding
[2017-12-06 20:15:08.780 INFO ] Rendered onboarding/index.html.haml within layouts/onboarding (2.0ms)
[2017-12-06 20:15:08.793 INFO ] Rendered shared/_head.html.haml (4.4ms)
[2017-12-06 20:15:08.796 INFO ] Rendered shared/_flash.html.haml (1.3ms)
[2017-12-06 20:15:08.798 INFO ] Rendered shared/_wiki_ed_footer.html.haml (1.0ms)
[2017-12-06 20:15:08.798 INFO ] Rendered shared/_foot.html.haml (2.0ms)
[2017-12-06 20:15:08.798 INFO ] Completed 200 OK in 24ms (Views: 21.0ms | ActiveRecord: 0.2ms)
::1 - - [06/Dec/2017:20:15:08 PST] "GET /onboarding?return_to=%2F500 HTTP/1.1" 200 8536
http://localhost:3000/onboarding -> /onboarding?return_to=%2F500

See also the failing travis build: https://travis-ci.org/WikiEducationFoundation/WikiEduDashboard/jobs/312735711

My app: https://github.com/WikiEducationFoundation/WikiEduDashboard

Expected behavior

No error, as on 2.4 and other Ruby versions.

Most helpful comment

Now Ruby 2.5 is released. How is the plan to release the new version? Just a beta release would be helpful too.

All 3 comments

Already fixed in https://github.com/plataformatec/devise/commit/1009096172f2cbc86bcd54d053c89a09be67fb9f

Will a new release be cut before Christmas?

Closing this since it's already fixed.

Will a new release be cut before Christmas?

Personally, there are some other things I'd like to merge before a new version release, but we'll see what we can do :)

Thank you!

Now Ruby 2.5 is released. How is the plan to release the new version? Just a beta release would be helpful too.

Was this page helpful?
0 / 5 - 0 ratings