title: Resque worker failing with PostgreSQL server
body: <p>I've managed to set up my workers and they used to execute without issue (in development) but now they don't in either production or development (I'm guessing after changing from SQlite3 to PostgreSQL).</p>
  
  <p>When I run a rake command to run the workers with <code>rake resque:work QUEUE=*</code> I get the following error and stack trace:</p>
  
  <pre><code>getaddrinfo: nodename nor servname provided, or not known
  </code></pre>
  
  <p>I get the following errors when running <code>heroku rake resque:work QUEUE=*</code> in the console to test pending workers in the queue.</p>
  
  <pre><code>Class         SentimentJob
  Arguments     [4, 5, 6]
  Exception     ActiveRecord::StatementInvalid
  Error         PGError: server closed the connection unexpectedly This probably means
                the server terminated abnormally before or while processing the request.
                : SELECT a.attname, format_type(a.atttypid, a.atttypmod), d.adsrc,
                a.attnotnull FROM pg_attribute a LEFT JOIN pg_attrdef d ON a.attrelid =
                d.adrelid AND a.attnum = d.adnum WHERE a.attrelid = '"taggings"'::regclass
                AND a.attnum &gt; 0 AND NOT a.attisdropped ORDER BY a.attnum
  </code></pre>
  
  <p>And for my Facebook worker:</p>
  
  <pre><code>Class         FBConnectionsJob
  Arguments     1
  Exception     OpenSSL::SSL::SSLError
  Error         SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B:
                certificate verify failed
  
  Class         FBConnectionsJob
  Arguments     1
  Exception     ActiveRecord::StatementInvalid
  Error         PGError: server closed the connection unexpectedly This probably means
                the server terminated abnormally before or while processing the request.
                : SELECT tablename FROM pg_tables WHERE schemaname = ANY
                (current_schemas(false)) 
  </code></pre>
  
  <p>Why do I get different errors in different environments? My initializer files look like:</p>
  
  <p><em>Should I add ENV specifications here?</em></p>
  
  <p><strong>Resque.rb</strong></p>
  
  <pre><code>uri = URI.parse(ENV["REDISTOGO_URL"])
  Resque.redis = Redis.new(:host =&gt; uri.host, :port =&gt; uri.port, :password =&gt; uri.password)
  Dir["#{Rails.root}/app/jobs/*.rb"].each { |file| require file }
  </code></pre>
  
  <p><strong>Redis.rb</strong></p>
  
  <pre><code>uri = URI.parse(ENV["REDISTOGO_URL"])
  REDIS = Redis.new(:host =&gt; uri.host, :port =&gt; uri.port, :password =&gt; uri.password)
  Resque.redis = REDIS
  </code></pre>
  
  <p>My <em>environments/production.rb</em> file has no reference to Redis and my <em>environments/development.rb</em> file has this for Redis setup:</p>
  
  <pre><code>ENV["REDISTOGO_URL"] = 'redis://username:password@my.host:6789' 
  </code></pre>