Add redis and redis config

This commit is contained in:
Rei
2014-02-28 13:16:21 +08:00
parent fa2bcd775e
commit 6412f939c4
4 changed files with 20 additions and 2 deletions

View File

@@ -74,6 +74,10 @@ gem 'http_accept_language', '~> 2.0.1'
# i18n
gem 'rails-i18n', '~> 4.0.1'
# redis
gem 'redis', '~> 3.0.7'
gem 'hiredis', '~> 0.4.5'
# Background jobs
gem 'resque', '~> 1.25.1'

View File

@@ -148,6 +148,7 @@ GEM
hashie (2.0.5)
highline (1.6.20)
hike (1.2.3)
hiredis (0.4.5)
http_accept_language (2.0.1)
http_parser.rb (0.5.3)
i18n (0.6.9)
@@ -276,6 +277,7 @@ DEPENDENCIES
font-awesome-sass (~> 4.0.2)
gravtastic (~> 3.2.6)
guard-livereload
hiredis (~> 0.4.5)
http_accept_language (~> 2.0.1)
i18n-tasks (~> 0.3.2)
jbuilder (~> 1.2)
@@ -289,6 +291,7 @@ DEPENDENCIES
rails!
rails-i18n (~> 4.0.1)
redcarpet (~> 3.0.0)
redis (~> 3.0.7)
resque (~> 1.25.1)
rouge (~> 1.3.1)
sass-rails!

View File

@@ -2,11 +2,16 @@ default: &default
name: Campo
host: localhost
admin_emails:
# - admin@example.com
mailer:
default_from: 'no-reply@example.com'
admin_emails:
# - admin@example.com
redis:
host: 127.0.0.1
port: 6379
db: 0
development:
<<: *default

View File

@@ -0,0 +1,6 @@
$redis = Redis.new(host: CONFIG['redis']['host'],
port: CONFIG['redis']['port'],
db: CONFIG['redis']['db'],
driver: :hiredis)
Resque.redis = $redis