Reputation: 101
I'm writing a rails app and I'm trying to use Devise. Following the setup instructions here, I am trying to do rails generate devise:install
, but I keep getting this error:
~/projects/readone/config/application.rb:8:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
I tried different things like uninstalling, reinstalling the gem, etc. I also found some similar errors on Google and elsewhere on Stack Overflow, but none of them had to do specifically with this undefined local variable or method `config'
error.
I'll include the full error below. Any idea what might be happening?
~/readone/config/application.rb:8:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
from /~/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/spring-1.2.0/lib/spring/application.rb:82:in `require'
from /~/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/spring-1.2.0/lib/spring/application.rb:82:in `preload'
from /~/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/spring-1.2.0/lib/spring/application.rb:143:in `serve'
from /~/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/spring-1.2.0/lib/spring/application.rb:131:in `block in run'
from /~/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/spring-1.2.0/lib/spring/application.rb:125:in `loop'
from /~/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/spring-1.2.0/lib/spring/application.rb:125:in `run'
from /~/.rbenv/versions/2.1.3/lib/ruby/gems/2.1.0/gems/spring-1.2.0/lib/spring/application/boot.rb:18:in `<top (required)>'
from /~/.rbenv/versions/2.1.3/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from /~/.rbenv/versions/2.1.3/lib/ruby/site_ruby/2.1.0/rubygems/core_ext/kernel_require.rb:54:in `require'
from -e:1:in `<main>'
Upvotes: 0
Views: 4479
Reputation: 101
Found the issue: I had a line in my config that said config.force_ssl = true. Commented it out and it worked! Considered deleting my question, but thought that maybe someone else might run into this sometime. –
Upvotes: 2