The error message 'cannot load such file -- redis/connection/hiredis' indicates that the Redis client is unable to locate the hiredis driver, which is required for communicating with Redis using the hiredis protocol. The hiredis driver is an optional dependency of the Redis Ruby client, meaning it is not included in the Redis client by default but needs to be added separately.
To fix this error, install the hiredis gem manually or update your Gemfile to include the hiredis gem. Once installed, require it in your code using
For Bundler, add the following line to your Gemfile and run
Or, to install it manually, run this command:
gem install hiredis
After installation, don't forget to require it in your code before creating a new Redis client instance.