FACEBOOK_CONFIG未初始化,因此WEBRick无法启动

时间:2014-09-28 15:25:52

标签: ruby-on-rails

启动WEBRick时会抛出错误,说我的FACEBOOK_CONFIG未初始化。我检查的所有内容对我来说都很好,但仍然会遇到同样的错误。

以下是错误消息

$ rails s
=> Booting WEBrick
=> Rails 4.1.4 application starting in development
=> Run `rails server -h` for more startup options
=> Notice: server is listening on all interfaces (--binding option)
=> Ctrl-C to shutdown server
Exiting
c:/Sites/ThinkBlog/crumblr/config/initializers/devise.rb:235:in `block in <top (required)>': undefined method `[]' for
 nil:NilClass (NoMethodError)
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/devise-3.3.0/lib/devise.rb:292:in `setup'
        from c:/Sites/ThinkBlog/crumblr/config/initializers/devise.rb:3:in `<top (required)>'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.1.4/lib/active_support/dependencies.
rb:241:in `load'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.1.4/lib/active_support/dependencies.
rb:241:in `block in load'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.1.4/lib/active_support/dependencies.
rb:232:in `load_dependency'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/activesupport-4.1.4/lib/active_support/dependencies.
rb:241:in `load'
        from c:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/railties-4.1.4/lib/rails/engine.rb:648:in `block in
load_config_initializer'

我的FACEBOOK_CONFIG看起来像这样,

FACEBOOK_CONFIG = YAML.load_file("#{::Rails.root}/config/facebook.yml")[::Rails.env]

有关为什么FACEBOOK_CONFIG未初始化的任何想法?

0 个答案:

没有答案