Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
每次 Rails 服务器启动时,我都想刷新 redis。
我怎样才能做到这一点?
提前致谢。
PS:我是rails新手,如果问题很简单,请原谅。
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