I just started working on an existing Rails codebase and I'm trying to run the tests in the codebase. However, when I run bundle exec rspec spec/
I get the following error on every test:
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'
I'm pretty new to rails -- I've only finished 8 of the 11 chapters in Michael Hartl's rails tutorial -- so I'm not familiar with Redis. My Redis version is redis-2.4.17
.
The problem was that I needed to increase the number of databases. To do so, I went to /usr/local/etc
and modified redis.conf
. I set the database number to 128: databases 128
.
Though it is too late but may be helpful for others.
If you are using database name like 'test' please replace it something index like '0' / 0. If you are not sure of index try 0 as your index.best of luck
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With