标签: ruby-on-rails redis
每次Rails服务器启动时我想要刷新redis。
我该怎么做?
先谢谢。
答案 0 :(得分:17)
port = 10000 $redis = Redis.new(:port => port) $redis.flushall
http://fhwang.net/2010/09/23/Testing-Rails-against-a-running-Redis-instance-and-doing-it-with-Hydra-to-boot
要在启动时运行,请检查https://stackoverflow.com/a/7091991/643500