title: bad URI(is not URI?): 'redis://redis.xxx.ng.0001.apse1.cache.amazonaws.com:6379/1' URI::InvalidURIError Rails with aws redis
body: <p>I am experiencing a strange issue from Passenger docker ruby 2.3 with aws redis:</p>
  
  <pre><code>bad URI(is not URI?): 'redis://redis.xxx.ng.0001.apse1.cache.amazonaws.com:6379/1' (URI::InvalidURIError)
    /usr/local/rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/uri/rfc3986_parser.rb:67:in `split'
    /usr/local/rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/uri/rfc3986_parser.rb:73:in `parse'
    /usr/local/rvm/rubies/ruby-2.3.8/lib/ruby/2.3.0/uri/common.rb:227:in `parse'
    /usr/local/rvm/gems/ruby-2.3.8/gems/sidekiq-5.2.7/lib/sidekiq/redis_connection.rb:97:in `log_info'
    /usr/local/rvm/gems/ruby-2.3.8/gems/sidekiq-5.2.7/lib/sidekiq/redis_connection.rb:31:in `create'
    /usr/local/rvm/gems/ruby-2.3.8/gems/sidekiq-5.2.7/lib/sidekiq.rb:126:in `redis_pool'
    /usr/local/rvm/gems/ruby-2.3.8/gems/sidekiq-5.2.7/lib/sidekiq.rb:94:in `redis'
  
  </code></pre>
  
  <p>My sidekiq config:</p>
  
  <pre><code># ENV['REDIS_URL']= redis://redis.xxx.ng.0001.apse1.cache.amazonaws.com:6379/1
  Sidekiq.configure_server do |config|
    config.redis = { url: ENV['REDIS_URL'] }
  end
  
  Sidekiq.configure_client do |config|
    config.redis = { url: ENV['REDIS_URL'] }
  end
  
  </code></pre>
  
  <p>However if I run:</p>
  
  <p>docker exec -it container_id bash</p>
  
  <p>and then rails console everything seems to work just fine.</p>
  
  <p>I also tried this:</p>
  
  <pre><code>redis_url = ENV['REDIS_URL']
  
  # The statement below parsed successfully thus the redis_url is correct
  uri = URI.parse(redis_url)
  
  redis_options = {
    host: uri.host,
    port: 6379,
    db: uri.path[1..-1]
  }
  
  Sidekiq.configure_server do |config|
    config.redis = redis_options
  end
  
  Sidekiq.configure_client do |config|
    config.redis = redis_options
  end
  
  </code></pre>
  
  <p>But it raised the exact same error. I could run the docker locally connected to local redis just fine. I am wondering there might be something wrong with the ENV['REDIS_URL'] value.</p>
  
  <p>Is there anyone experiencing this issue or any clues?</p>
  
  <p>My env is 
  - passenger-docker ruby 2.3.8
  - aws elastic cache redis: 5.0.5
  - sidekiq 5.2.7</p>
  
  <p><a href="https://i.stack.imgur.com/tKDdg.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tKDdg.png" alt="enter image description here"></a></p>