WEBRIck无法启动..忘记错误消息

时间:2014-09-28 04:04:42

标签: ruby-on-rails ruby ruby-on-rails-3 devise

以下是我在执行rails时遇到的新错误消息....

  

退出   C:/Sites/ThinkBlog/crumblr/config/initializers/devise.rb:235:block in <top (required)>': undefined method []'为零:NilClass   (NoMethodError)来自   C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-3.3.0/lib/devise.rb:292:在   setup' from C:/Sites/ThinkBlog/crumblr/config/initializers/devise.rb:3:in<顶   (需要)GT;'从   C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.1.4/lib/active_support/dependencies.rb:241:在`load'

顺便说一下,device.rb中的第235行是

config.omniauth :facebook, FACEBOOK_CONFIG['facebook_api_key'], FACEBOOK_CONFIG['facebook_api_secret']

1 个答案:

答案 0 :(得分:0)

错误消息可以准确地告诉您代码的错误:undefined method[]' for nil或者换句话说:您尝试在对象[]上调用nil方法。

由于您只在[]上致电FACEBOOK_CONFIG,因此出现此错误的唯一原因是:FACEBOOK_CONFIG未初始化,因此nil