Redis :: CommandError:运行rspec时ERR无效的DB索引

Max*_*iel 15 rspec ruby-on-rails redis

我刚刚开始研究现有的Rails代码库,我正在尝试在代码库中运行测试.但是,当我运行时,我bundle exec rspec spec/在每次测试时都会收到以下错误:

Failure/Error: Unable to find matching line from backtrace
Redis::CommandError:
   ERR invalid DB index
 # ./lib/redised.rb:35:in `flushdb_all'
 # ./lib/redised.rb:35:in `each_value'
 # ./lib/redised.rb:35:in `flushdb_all'
Run Code Online (Sandbox Code Playgroud)

我对rails非常陌生 - 我在Michael Hartl的rails教程中只完成了11章中的8章 - 所以我对Redis并不熟悉.我的Redis版本是redis-2.4.17.

Max*_*iel 25

问题是我需要增加数据库的数量.为此,我去了/usr/local/etc并修改了redis.conf.我将数据库编号设置为128 : databases 128.