Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devise syntax error (Possibly ruby-2.5 related?) #4630

Closed
EleanorRagone opened this issue Sep 1, 2017 · 9 comments
Closed

Devise syntax error (Possibly ruby-2.5 related?) #4630

EleanorRagone opened this issue Sep 1, 2017 · 9 comments

Comments

@EleanorRagone
Copy link

A little background: I came across this starter rails app and figured I'd try it out. Set it up on my current ubuntu server, ran through the instructions, and ended up with this error:

Started GET "/users/sign_in" for 172.16.1.106 at 2017-08-31 21:47:50 -0400

SyntaxError - syntax error, unexpected '{', expecting keyword_end
...ion only: [:create, :destroy] { request.env["devise.skip_tim...
...                              ^
/home/pragone/.rvm/gems/ruby-2.4.0@swapandsnooze/gems/devise-4.3.0/app/controllers/devise/sessions_controller.rb:5: syntax error, unexpected '}', expecting keyword_end
..."devise.skip_timeout"] = true }
...                              ^:
  devise (4.3.0) app/controllers/devise/sessions_controller.rb:5:in `'

2017-08-31 21:47:50 -0400: Rack app error handling request { GET /500 }
#<NoMethodError: undefined method `*' for nil:NilClass>
Error reached top of thread-pool: undefined method `join' for nil:NilClass (NoMethodError)

I also tried running it in the VM created by this repository, where everything worked swimmingly.

The only difference I think I can come up with is the version of ruby puma seems to be calling for no good reason that I can find:

My server:

ruby/2.5.0 isn't supported by this pry-doc version
=> Booting Puma
=> Rails 5.1.3 application starting in development on http://172.16.1.210:3001
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.10.0 (ruby 2.5.0-p-1), codename: Russell's Teapot
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://172.16.1.210:3001
Use Ctrl-C to stop

Vagrant VM from https://github.com/brunofacca/rails-development-environment:

=> Booting Puma
=> Rails 5.1.3 application starting in development on http://0.0.0.0:3002
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.9.1 (ruby 2.4.0-p0), codename: Private Caller
* Min threads: 5, max threads: 5
* Environment: development
* Listening on tcp://0.0.0.0:3002
Use Ctrl-C to stop

Somehow it seems my server is trying to start puma in ruby-2.5.0, despite the current RVM gemset being ruby-2.4.0. I don't even have 2.5 installed. I have literally no idea where it's getting that from (frankly, I'm just assuming that's what's going on).

I'm not really sure what to say about this, other than I spent an inordinate amount of time trying to figure out what's going on and still don't know.

@rafaelfranca
Copy link
Collaborator

Seems you find a bug with Ruby 2.5.0. Please report to the Ruby issue tracker.

@remomueller
Copy link

remomueller commented Nov 14, 2017

For anyone trying out devise with MRI 2.5.0-preview1, it looks like devise has a fix for this on the master branch: 1009096

Add the following to gems.rb (or Gemfile):

# gem 'devise',               '~> 4.3.0'
gem 'devise', git: 'https://github.com/plataformatec/devise' #, ref: '88e9a85'

The ref is optional but can be used in case master is failing.

Also, here is a related (closed) issue on the Ruby issue tracker: https://bugs.ruby-lang.org/issues/13939

@jerryjohnjacob
Copy link

Just wanted to add that devise v4.4.0 has a fix to this problem

@martinos
Copy link

In order to help people migrating their old apps. I think It would be great apply this patch on devise 3.5. Because migrating to an app to ruby 2.5 would imply migrating to devise 4.

@tegon
Copy link
Member

tegon commented Feb 26, 2018

This patch was also added to the 3-stable branch: bddf051

@marksiemers
Copy link

@rafaelfranca - Any plans to have a rubygems release for 3.x for this patch?

@webark
Copy link

webark commented Aug 30, 2018

@marksiemers did this ever happen?

@marksiemers
Copy link

@webark - I don't think so. The latest tag I see for 3.x is from 2016: https://github.com/plataformatec/devise/releases/tag/v3.5.10

@wesgarrison
Copy link

Future searchers, here is how to use the 3-stable branch in your Gemfile:

gem 'devise', git: 'https://github.com/plataformatec/devise' , branch: '3-stable'

This works for me on ruby 2.5 and rails 4.2.11.1 .

leppert added a commit to reading-am/reading that referenced this issue Mar 30, 2020
dacort added a commit to metabase/static-embedding-reference-apps that referenced this issue May 27, 2020
- Bump puma to 3.7.x so specifying the port via rails server -p works
  puma/puma#1200
- Bump devise to 4.4.x due to a syntax error
  heartcombo/devise#4630
zflat added a commit to FreeRidePGH/BikeBinder that referenced this issue Dec 5, 2021
freedeveloper000 added a commit to freedeveloper000/spree_auth_devise that referenced this issue Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

9 participants