虚荣,Rails 3和Heroku [英] Vanity, Rails 3 and Heroku

查看:107
本文介绍了虚荣,Rails 3和Heroku的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图让Vanity与Heroku和我的Rails 3应用程序一起玩。目前,它在本地使用Pow和本地Redis服务器都可以正常工作,但是当我使用RedisToGo插件推送到Heroku时,似乎没有任何东西能够让服务器运行,我只是收到错误消息: getaddrinfo:名称或服务未知



这是我的config / vanity.yml文件:

 暂存:
适配器:redis
主机:<%= ENV [REDISTOGO_URL]%>

和我的config / initializers / redis.rb:

  uri = URI.parse(ENV [REDISTOGO_URL])
REDIS = Redis.new(:host => uri.host,:port => uri.port,:password => uri.password)

我也尝试使用实际 redis://< actualusername>:actualpassword@actualserver.com:9274 并且它给出相同的错误。我也尝试过使用和不使用 redis://



有没有人得到Vanity与Heroku合作以及Rails 3?我错过了一些非常明显的东西吗?我的Google-fu到目前为止已经失败了。

是的,这是愚蠢的,好吧。您不使用 host ,您可以使用 connection

  staging:
适配器:redis
连接:<%= ENV [REDISTOGO_URL]%>

希望这可以帮助某人,因为我几乎把我的电脑打到了纸浆。


I'm trying to get Vanity to play nicely with Heroku and my Rails 3 app. At the moment, it all works fine locally using Pow and a local Redis server, but when I push to Heroku using the RedisToGo add-on, nothing seems to get the server running, I just get the error: getaddrinfo: Name or service not known.

Here's my config/vanity.yml file:

staging:
  adapter: redis
  host: <%= ENV["REDISTOGO_URL"] %> 

and my config/initializers/redis.rb:

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

I've also tried using the actual redis://<actualusername>:actualpassword@actualserver.com:9274 and it gives the same error. I've also tried with and without the redis://.

Has anyone got Vanity working with Heroku and Rails 3? Am I missing something terribly obvious? My Google-fu has failed me thus far.

解决方案

Yeah, it was something stupid, all right. You don't use host, you use connection.

staging:
  adapter: redis
  connection: <%= ENV["REDISTOGO_URL"] %> 

Hope this helps someone, because I nearly beat my computer to a pulp.

这篇关于虚荣,Rails 3和Heroku的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆