Update 4 files to be able to parse config/redis.yml with ERB.
config/initializers/message_bus.rb
- MessageBus.redis_config = YAML::load(File.open("#{Rails.root}/config/redis.yml"))[Rails.env].symbolize_keys
+ MessageBus.redis_config = YAML.load(ERB.new(File.new("#{Rails.root}/config/redis.yml").read).result)[Rails.env].symbolize_keys
config/initializers/mini_profiler.rb
- Rack::MiniProfiler.config.storage_options = YAML::load(File.open("#{Rails.root}/config/redis.yml"))[Rails.env].symbolize_keys
+ Rack::MiniProfiler.config.storage_options = YAML.load(ERB.new(File.new("#{Rails.root}/config/redis.yml").read).result)[Rails.env].symbolize_keys
In these last two files, also include the password config.
config/application.rb
- redis_config = YAML::load(File.open("#{Rails.root}/config/redis.yml"))[Rails.env]
- redis_store = ActiveSupport::Cache::RedisStore.new "redis://#{redis_config['host']}:#{redis_config['port']}/#{redis_config['cache_db']}"
+ redis_config = YAML.load(ERB.new(File.new("#{Rails.root}/config/redis.yml").read).result)[Rails.env]
+ redis_store = ActiveSupport::Cache::RedisStore.new "redis://:#{redis_config['password']}@#{redis_config['host']}:#{redis_config['port']}/#{redis_config['cache_db']}"
lib/discourse_redis.rb
- @config = YAML::load(File.open("#{Rails.root}/config/redis.yml"))[Rails.env]
- redis_opts = {:host => @config['host'], :port => @config['port'], :db => @config['db']}
+ @config = YAML.load(ERB.new(File.new("#{Rails.root}/config/redis.yml").read).result)[Rails.env]
+ redis_opts = {:host => @config['sidekiq_host'], :port => @config['sidekiq_port'], :db => @config['db'], :password => @config['sidekiq_password']}
bundle exec foreman run rake assets:precompile