Search code examples
rubyherokuredis

Cannot access databases on heroku rediscloud


Using a rediscloud 1GB plan, I cannot seem to connect to a specified siloed database. E.g., in ruby (using ruby 2.2.10, redis ruby library v3.3.5):

redis = Redis.new(url: ENV['REDISCLOUD_URL'], db: 4)
redis.get 'foo' # => Redis::CommandError: ERR DB index is out of range

Similar result is obtained when specifying the db in the url parameter:

redis = Redis.new(url: "#{ENV['REDISCLOUD_URL']}/4")
redis.get 'foo' # => Redis::CommandError: ERR DB index is out of range

I have not encountered this problem with other redis instances. Am I misunderstanding something about redis, dbs, or rediscloud?


Solution

  • From what I can gather, it looks like rediscloud is a product that does not automatically come with databases. It requires that you manually add them, notwithstanding that the plan indicates that the databases are included. Relevant documentation.