I have had lots of trouble with deploying my rails 3.0.10 application to Ubuntu 10.04 server with Passenger, Capistrano, nginx and MySQL (and even more trouble with apache2)
For me it was sufficient to remove the search line in my resolv.conf. My company inserted automatically it's own domain and my hostname was not a FQDN in my hosts file. This is a test environment obviously.
I've been having the same issue with rails and logstasher on OSX, couldn't figure out what was going on until I read this post. Thought I'd add this so that anyone else having the same kind of issue with logstasher can find something...
`=> Booting Unicorn
=> Rails 4.2.5 application starting in development on http://0.0.0.0:3000
=> Run rails server -h for more startup options
=> Ctrl-C to shutdown server
Exiting
/Users/xx/Projects/xx/config/environments/development.rb:80:in 'getaddress': getaddrinfo: nodename nor servname provided, or not known (SocketError)`
Fix was to add my machine hostname to the list under /etc/hosts for 127.0.0.1
It could be that one of your third party service URLs is incorrect. For example, we had the wrong SMTP mail address. An exception within the app caused it to email the error to the admins and it failed with the error. Here's how you know when it's a bad address:
irb(main):009:0> Socket.gethostbyname("example.net")
SocketError: getaddrinfo: Name or service not known
I added this line to the top of file app/controllers/search_controller.rb
require 'resolv-replace'
Or alternatively you can put it to initializers/requires.rb
just a wild guess, any chance you are using localhost as the hostname? Try changing localhost to 127.0.0.1
I had a similar issue, which I worked around by editing the /etc/resolv.conf
before
nameserver 10.0.x.x
search example.com
after
#nameserver 10.0.x.x
nameserver 8.8.8.8
#search example.com