title: Getting "`initialize': getaddrinfo: nodename nor servname provided, or not known (SocketError)" when saying smtp.start
body: <p>I'm trying to send an email using my gmail in a very simple ruby script. This is the part that is supposed to send an email to <code>RECEIVER</code>from <code>SENDER</code> which is me. For <code>PASSWD</code>I use my gmail password.</p>
  
  <pre><code>smtp = Net::SMTP.new 'smtp.gmail.com', 587
  smtp.enable_starttls
  smtp.start('gmail.com', SENDER, PASSWD, :login)
  smtp.send_message message, SENDER, RECEIVER
  smtp.finish
  </code></pre>
  
  <p>Now, I always get this error:</p>
  
  <pre><code>/Users/David/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/net/smtp.rb:540:in `initialize': getaddrinfo: nodename nor servname provided, or not known (SocketError)
  from /Users/David/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/net/smtp.rb:540:in `open'
  from /Users/David/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/net/smtp.rb:540:in `tcp_socket'
  from /Users/David/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/net/smtp.rb:549:in `block in do_start'
  from /Users/David/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/timeout.rb:68:in `timeout'
  from /Users/David/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/timeout.rb:99:in `timeout'
  from /Users/David/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/net/smtp.rb:549:in `do_start'
  from /Users/David/.rvm/rubies/ruby-1.9.3-p374/lib/ruby/1.9.1/net/smtp.rb:525:in `start'
  </code></pre>
  
  <p>The weird thing is that it worked one or two days ago and I didn't change the script. </p>
  
  <p>I did update Ruby and Rails, though, within the last two days and I'm not sure if I tested the script before or after the update. Could that be related?</p>
  
  <p>Does anyone have an idea what's going on here and a possible solution?</p>