我最近使用虚荣部署了一些 A/B 测试实验到我的 heroku 实例。但是,每当我访问仪表板时,即 /vanity 日志中都会显示以下错误
- ActionView::Template::Error (Connection refused - Unable to connect to Redis on 127.0.0.1:6379):
- 1: <ul class="experiments">
- 2: <% experiments.sort_by { |id, experiment| experiment.created_at }.reverse.each do |id, experiment| %>
- 3: <li class="experiment <%= experiment.type %>" id="experiment_<%=vanity_h id.to_s %>">
- 4: <%= render :file => Vanity.template("_experiment"), :locals => { :id => id, :experiment => experiment } %>
- 5: </li>
-
但是,redis to go url 似乎设置正确,虚荣似乎能够访问它,例如
irb(main):011:0> Vanity.playground.connection
=> redis://bluegill.redistogo.com:9231/0
任何人都知道我可能做错了什么?
my vanity.rb config file is fairly standard
development:
adapter: redis
connection: redis://localhost:6379/0
qa:
adapter: redis
connection: <%= ENV["REDISTOGO_URL"] %>
staging:
adapter: redis
connection: <%= ENV["REDISTOGO_URL"] %>
production:
adapter: redis
connection: <%= ENV["REDISTOGO_URL"] %>
而且 ENV["REDISTOGO_URL"] 似乎是正确的
irb(main):012:0> ENV["REDISTOGO_URL"]
=> "redis://redistogo:e1ab3fa23beacbcd481cd4508ad0090c@bluegill.redistogo.com:9231/"
而且我可以从应用程序的其余部分访问 Redis,似乎 Vanity 没有为这个模板选择它。