Reputation: 2102
I'm trying to use devise gem on a rails app.
That's what I do:
rails new DeviseApp
cd ./DeviseApp
bundle install
Then I go to the gemfile inside the project and put that code:
gem 'devise'
After that, I perform another bundle install
Then I try the following: rails generate devise:install
I obtain the following error:
/Users/lechucico/.rvm/gems/[email protected]/gems/bundler-1.14.6/lib/bundler/runtime.rb:94:in `rescue in block (2 levels) in require': There was an error while trying to load the gem 'devise'.
Gem Load Error is: undefined method `alias_method_chain' for ActionDispatch::Routing::RouteSet:Class
Did you mean? alias_method
Backtrace for gem load error is:
/Users/lechucico/.rvm/gems/[email protected]/gems/devise-1.5.4/lib/devise/rails/routes.rb:14:in `<class:RouteSet>'
/Users/lechucico/.rvm/gems/[email protected]/gems/devise-1.5.4/lib/devise/rails/routes.rb:2:in `<module:Routing>'
/Users/lechucico/.rvm/gems/[email protected]/gems/devise-1.5.4/lib/devise/rails/routes.rb:1:in `<top (required)>'
/Users/lechucico/.rvm/gems/[email protected]/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `require'
/Users/lechucico/.rvm/gems/[email protected]/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `block in require'
/Users/lechucico/.rvm/gems/[email protected]/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:258:in `load_dependency'
/Users/lechucico/.rvm/gems/[email protected]/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `require'
/Users/lechucico/.rvm/gems/[email protected]/gems/devise-1.5.4/lib/devise/rails.rb:1:in `<top (required)>'
/Users/lechucico/.rvm/gems/[email protected]/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `require'
/Users/lechucico/.rvm/gems/[email protected]/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `block in require'
/Users/lechucico/.rvm/gems/[email protected]/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:258:in `load_dependency'
/Users/lechucico/.rvm/gems/[email protected]/gems/activesupport-5.1.1/lib/active_support/dependencies.rb:292:in `require'
/Users/lechucico/.rvm/gems/[email protected]/gems/devise-1.5.4/lib/devise.rb:445:in `<top (required)>'
/Users/lechucico/.rvm/gems/[email protected]/gems/bundler-1.14.6/lib/bundler/runtime.rb:91:in `require'
/Users/lechucico/.rvm/gems/[email protected]/gems/bundler-1.14.6/lib/bundler/runtime.rb:91:in `block (2 levels) in require'
/Users/lechucico/.rvm/gems/[email protected]/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `each'
/Users/lechucico/.rvm/gems/[email protected]/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `block in require'
/Users/lechucico/.rvm/gems/[email protected]/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `each'
/Users/lechucico/.rvm/gems/[email protected]/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `require'
/Users/lechucico/.rvm/gems/[email protected]/gems/bundler-1.14.6/lib/bundler.rb:107:in `require'
/Users/lechucico/Documents/rails/DeviseApp/config/application.rb:7:in `<top (required)>'
/Users/lechucico/.rvm/gems/[email protected]/gems/spring-2.0.1/lib/spring/application.rb:82:in `require'
/Users/lechucico/.rvm/gems/[email protected]/gems/spring-2.0.1/lib/spring/application.rb:82:in `preload'
/Users/lechucico/.rvm/gems/[email protected]/gems/spring-2.0.1/lib/spring/application.rb:143:in `serve'
/Users/lechucico/.rvm/gems/[email protected]/gems/spring-2.0.1/lib/spring/application.rb:131:in `block in run'
/Users/lechucico/.rvm/gems/[email protected]/gems/spring-2.0.1/lib/spring/application.rb:125:in `loop'
/Users/lechucico/.rvm/gems/[email protected]/gems/spring-2.0.1/lib/spring/application.rb:125:in `run'
/Users/lechucico/.rvm/gems/[email protected]/gems/spring-2.0.1/lib/spring/application/boot.rb:19:in `<top (required)>'
/Users/lechucico/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
/Users/lechucico/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
-e:1:in `<main>'
Bundler Error Backtrace:
(Bundler::GemRequireError)
from /Users/lechucico/.rvm/gems/[email protected]/gems/bundler-1.14.6/lib/bundler/runtime.rb:90:in `block (2 levels) in require'
from /Users/lechucico/.rvm/gems/[email protected]/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `each'
from /Users/lechucico/.rvm/gems/[email protected]/gems/bundler-1.14.6/lib/bundler/runtime.rb:86:in `block in require'
from /Users/lechucico/.rvm/gems/[email protected]/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `each'
from /Users/lechucico/.rvm/gems/[email protected]/gems/bundler-1.14.6/lib/bundler/runtime.rb:75:in `require'
from /Users/lechucico/.rvm/gems/[email protected]/gems/bundler-1.14.6/lib/bundler.rb:107:in `require'
from /Users/lechucico/Documents/rails/DeviseApp/config/application.rb:7:in `<top (required)>'
from /Users/lechucico/.rvm/gems/[email protected]/gems/spring-2.0.1/lib/spring/application.rb:82:in `require'
from /Users/lechucico/.rvm/gems/[email protected]/gems/spring-2.0.1/lib/spring/application.rb:82:in `preload'
from /Users/lechucico/.rvm/gems/[email protected]/gems/spring-2.0.1/lib/spring/application.rb:143:in `serve'
from /Users/lechucico/.rvm/gems/[email protected]/gems/spring-2.0.1/lib/spring/application.rb:131:in `block in run'
from /Users/lechucico/.rvm/gems/[email protected]/gems/spring-2.0.1/lib/spring/application.rb:125:in `loop'
from /Users/lechucico/.rvm/gems/[email protected]/gems/spring-2.0.1/lib/spring/application.rb:125:in `run'
from /Users/lechucico/.rvm/gems/[email protected]/gems/spring-2.0.1/lib/spring/application/boot.rb:19:in `<top (required)>'
from /Users/lechucico/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from /Users/lechucico/.rvm/rubies/ruby-2.4.0/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from -e:1:in `<main>'
What I can do?
Upvotes: 0
Views: 316
Reputation: 476
There is a fix for this in the master branch for devise. You can install it directly by having the following lines in your gemfile:
gem 'devise', git: 'https://github.com/plataformatec/devise.git', branch: 'master'
gem 'erubis'
see discussion here
Upvotes: 1