title: Why does Tire not connect to ElasticSearch in production mode (RoR)?
body: <p>I have a VPS with Ubuntu 10.04 and Nginx on it and a Rails App that gets deployed to it via capistrano. So far, everything works fine. Yesterday I tried to integrate Sunspot/Solr, which was a complete desaster, becaused it wrecked my whole server and the app.
  So, today I tried Tire/ElasticSearch as a combination to use for full-text-search. In my local development environment everythings works fine. I installed ES via homebrew and got it up and running. After a little bit of testing I deployed the app to my VPS and installied ES on this server.
  When I start ES it gives me a PID and seems to work fine, but the problem is, that it seems like the tire-gem can't connect to it or find it. Because I can't save a object which would be indexed or search for something in the databse. I always get the message (I changed the IP address myself to 0.0.0.0):</p>
  
  <pre><code>Started GET "/food?utf8=%E2%9C%93&amp;query=hamburger" for 0.0.0.0 at 2011-12-22 16:43:07 +0100
  Processing by PostsController#index as HTML
  Parameters: {"utf8"=&gt;"✓", "query"=&gt;"hamburger"}
  Completed 500 Internal Server Error in 11ms
  
  Errno::ECONNREFUSED (Connection refused - connect(2)):
  app/models/food.rb:23:in search'
  app/controllers/food_controller.rb:12:inindex'
  </code></pre>
  
  <p>The message is nearly the same if I try to save something, only the code line where the error occurs is different.</p>
  
  <p>I've been searching for hours to find out where the error is, if I missed something in the configuration or what the problem is, but I just can't seem to find it.
  I've been thinking that the problem is
  a) Tire doesn't know how to find ES, even if there is no configuration to set
  b) IPTables or Nginx cause the error</p>
  
  <p>And also I can't open my-domain.com:9200 to access ES, but probably this is due to Nginx. Only thing is that I couldn't find anybody on the web who had the same problem or shared a way to do this.</p>
  
  <p>I would really appreciate your help.</p>