Uninitialized constant Warden (NameError)
truongnmt opened this issue · comments
I have this error while running the install command rails generate authtrail:install
. Just tried today and have this problem.
This project is using Rails 5.2.3, Ruby 2.6.2.
Traceback (most recent call last):
20: from bin/rails:6:in `<main>'
19: from bin/rails:6:in `require'
18: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands.rb:18:in `<top (required)>'
17: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/command.rb:46:in `invoke'
16: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/command/base.rb:65:in `perform'
15: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
14: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
13: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
12: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/commands/generate/generate_command.rb:21:in `perform'
11: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/command/actions.rb:14:in `require_application_and_environment!'
10: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/command/actions.rb:22:in `require_application!'
9: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/railties-5.2.3/lib/rails/command/actions.rb:22:in `require'
7: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler.rb:114:in `require'
6: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:65:in `require'
5: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:65:in `each'
4: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:76:in `block in require'
3: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:76:in `each'
2: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:81:in `block (2 levels) in require'
1: from ~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/bundler-2.0.2/lib/bundler/runtime.rb:81:in `require'
~/.rbenv/versions/2.6.2/lib/ruby/gems/2.6.0/gems/authtrail-0.2.0/lib/authtrail.rb:65:in `<top (required)>': uninitialized constant Warden (NameError)
Hey @truongnmt, I'm not sure how to reproduce. It seems to work with a fresh Rails app and lib/authtrail.rb
has require "warden"
at the top.
Hey @truongnmt, can you describe the solution for others who might come across this message?
Actually I test again today on new project and I got this error again :/
Attach a sample project, can you have a look.
sample_app.zip
Hey @truongnmt, I wasn't able to reproduce on a fresh app, so think you'll have to dig into this on your own. Please update us if you find anything.