我正在编写一个Rails应用程序,并且试图使用Devise。按照此处的设置说明,我正在尝试执行操作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 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>'
找到了问题:我的配置中有一行说config.force_ssl = true。评论出来,它起作用了!考虑删除我的问题,但认为也许有人会碰到这个时候。–
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句