This README would normally document whatever steps are necessary to get the application up and running.
Things you may want to cover:
-
Ruby version
-
System dependencies
-
Configuration
-
Database creation
-
Database initialization
-
How to run the test suite
-
Services (job queues, cache servers, search engines, etc.)
-
Deployment instructions
-
... REDIS_CONFIG = YAML.load(File.open(Rails.root.join('config/redis.yml'))).symbolize_keys default_config = REDIS_CONFIG[:default].symbolize_keys redis_config = default_config.merge(REDIS_CONFIG[Rails.env.to_sym].symbolize_keys) if REDIS_CONFIG[Rails.env.to_sym]
$redis = Redis.new(redis_config)
$namespaced_redis = Redis::Namespace.new(redis_config[:namespace], redis: $redis) if redis_config[:namespace]
begin
$redis.flushdb if Rails.env == 'test'
$redis.flushdb if Rails.env == 'development'
rescue Exception => e
p '-' * 20
p "Error trying with $redis.flushdb: #{e.message}"
p 'You may need to start the redis-server with sudo service redis-server start
'
p 'If the redis-server is not installed, please sudo apt-get install redis-server
.'
p 'You are not using linux? See you.'
p '-' * 20
rails_pid = Process.pid
cmd = "kill -SIGINT #{rails_pid}"
#{cmd}
end