我正在尝试在我的应用中设置设置:
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行)
为什么会这样?