deploying redis to heroku unable to connect

前端 未结 3 1098
别跟我提以往
别跟我提以往 2020-12-25 15:12

ive been trying to get resque to work with heroku. i can successfully get it to work in development mode, however when i try pushing to heroku i get

Errno::E         


        
3条回答
  •  清歌不尽
    2020-12-25 15:50

    For my setup I have /config/initializers/redis.rb with these lines:

    uri = URI.parse(ENV["REDISTOGO_URL"] || "redis://localhost:6379/" )
    REDIS = Redis.new(:host => uri.host, :port => uri.port, :password => uri.password)
    

    My REDISTOGO_URL is defined in my heroku configuration. You should be able to validate that by typing:

    heroku config --app my_app
    

    You'll see in the output the value for REDISTOGO_URL

    You should copy your REDISTOGO_URL directly from Redis To Go. You find it in by going to the instance in heroku and clicking on Add Ons -> Redis To Go.

    Here are a couple pointers:

    1. Verify you have your REDIS_TO_GO URL in your heroku config from the command line like I've demonstrated above.
    2. Verify the REDIS_TO_GO URL is identical to the one assigned to that instance in the Add Ons -> Redis To Go config.

提交回复
热议问题