rails 3 settingslogic uninitialized constant Settingslogic错误

时间:2012-12-29 15:49:21

标签: ruby-on-rails settingslogic

我正在尝试在我的应用中设置设置:

/ app / models / _settings.rb

class Settings < Settingslogic
    source "#{Rails.root}/config/app_config.yml"
    namespace Rails.env
end

在config / app_config中:

# config/app_config.yml
defaults: &defaults
  global_param: "global"
  awesome_setting: 1 #<%= "Did you know 5 + 5 = #{5 + 5}?" %>

development:
  <<: *defaults
  mongo:
    ip: "localhost"

backoffice:
  <<: *defaults 
  mongo:
    ip: "10.111.144.139"

staging:
  <<: *defaults
  mongo:
    ip: "10.111.144.139"


production:
  <<: *defaults
  mongo:
    ip: "10.111.144.139"

在我的app / helpers / kanbanFacade.rb第98行:

conn = Mongo::Connection.new(Settings.mongo.ip, 27017)

我仍然收到此错误: uninitialized constant KanbanFacade::Settings(在我的app帮助器第98行)

为什么会这样?

0 个答案:

没有答案