Skip to content
This repository has been archived by the owner on Jan 30, 2024. It is now read-only.

Error on Rails 5.1.2 #222

Closed
maengkom opened this issue Jul 8, 2017 · 8 comments
Closed

Error on Rails 5.1.2 #222

maengkom opened this issue Jul 8, 2017 · 8 comments

Comments

@maengkom
Copy link

maengkom commented Jul 8, 2017

Add to gemfile, then bundle install.
After that just type rails generate devise_security_extension:install raise this error.

/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:85:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'devise_security_extension'.
Gem Load Error is: undefined method `to_prepare' for ActionDispatch::Callbacks:Class
Did you mean?  to_param
Backtrace for gem load error is:
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/devise_security_extension-0.9.2/lib/devise_security_extension/rails.rb:7:in `<class:Engine>'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/devise_security_extension-0.9.2/lib/devise_security_extension/rails.rb:2:in `<module:DeviseSecurityExtension>'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/devise_security_extension-0.9.2/lib/devise_security_extension/rails.rb:1:in `<top (required)>'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `block in require'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:258:in `load_dependency'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/activesupport-5.1.2/lib/active_support/dependencies.rb:292:in `require'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/devise_security_extension-0.9.2/lib/devise_security_extension.rb:92:in `<top (required)>'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:82:in `require'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:82:in `block (2 levels) in require'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:77:in `each'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:77:in `block in require'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:66:in `each'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:66:in `require'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler.rb:108:in `require'
/Users/tester/Code/Turboly/turboly-fleet/config/application.rb:17:in `<top (required)>'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/Users/tester/.rbenv/versions/2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
-e:1:in `<main>'
Bundler Error Backtrace:
 (Bundler::GemRequireError)
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:77:in `each'
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:77:in `block in require'
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:66:in `each'
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler/runtime.rb:66:in `require'
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/bundler-1.15.1/lib/bundler.rb:108:in `require'
  from /Users/tester/Code/Turboly/turboly-fleet/config/application.rb:17:in `<top (required)>'
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `require'
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:92:in `preload'
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:153:in `serve'
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:141:in `block in run'
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `loop'
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application.rb:135:in `run'
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/gems/2.4.0/gems/spring-2.0.2/lib/spring/application/boot.rb:19:in `<top (required)>'
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  from /Users/tester/.rbenv/versions/2.4.1/lib/ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
  from -e:1:in `<main>'
@jdarnok
Copy link

jdarnok commented Jul 19, 2017

Hey @maengkom. This is warning from the 5.0:
DEPRECATION WARNING: to_prepare is deprecated and will be removed from Rails 5.1 (use ActiveSupport::Reloader.to_prepare instead)

@maengkom
Copy link
Author

@jdarnok thanks for reply, what should I do ? sorry just couple months using rails. I have to fork and modify it correct ? and where is it ?

Thanks.

@jdarnok
Copy link

jdarnok commented Jul 21, 2017

@maengkom if you really want that feature without sweat, just revert to rails 5.0 - it's not desirable solution, but maybe (MAYBE) someone will patch that gem. If you want to fork, you must change all 'to_prepare' statements or wait for the fix. Unfortunately I don't have time for making those fixes ATM, and to be honest I don't know the project's codebase so I can't help you with that.

@jdarnok
Copy link

jdarnok commented Jul 21, 2017

@maengkom
Check some pull requests though
#188

@maengkom
Copy link
Author

@jdarnok yes thanks for the link. I'll try to read the PR code.

@MohamedBrary
Copy link

MohamedBrary commented Jul 21, 2017

@maengkom Here is what I did for this issue, till the gem gets updated to Rails 5.1

#223 (comment)

@narutoo9x
Copy link

narutoo9x commented Jul 26, 2017

@maengkom upgrade the gem to lastest version will fix it.

gem 'devise_security_extension', git: 'https://github.com/phatworx/devise_security_extension.git'

@maengkom
Copy link
Author

@narutoo9x oh yeah I never reference to git directly, it works. Thanks. @MohamedBrary thank you for the tip.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants