我正在编写一个rails应用程序而我正在尝试使用Devise。在setup instructions here之后,我正在尝试rails generate devise:install
,但我一直收到此错误:
~/projects/readone/config/application.rb:8:in `<top (required)>': undefined local variable or method `config' for main:Object (NameError)
我尝试过卸载,重新安装gem等不同的东西。我还在Google Stack和其他地方的Stack Overflow上发现了一些类似的错误,但是没有一个错误专门针对这个undefined local variable or method `config'
错误。
我将在下面包含完整的错误。知道可能会发生什么吗?
~/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>'
答案 0 :(得分:1)
发现问题:我的配置中有一行说config.force_ssl = true。评论出来,它的工作原理!考虑删除我的问题,但认为可能有人可能会遇到这个问题。 -