MBJH
MBJH

Reputation: 1639

start up issue -- getaddrinfo: nodename nor servname provided, or not known (SocketError)

I am using NetBeans IDE 8, ruby-2.2.0-p0, mysql2, iMac,OS X 10.9.5

I am trying to run my app in production mode, I get:

   => Booting WEBrick
   => Rails 4.2.0 application starting in production on http://localhost:3000
   => Run `rails server -h` for more startup options
   => Ctrl-C to shutdown server
   [2015-05-19 20:05:56] INFO  WEBrick 1.3.1
   [2015-05-19 20:05:56] INFO  ruby 2.2.0 (2014-12-25)
   [x86_64-darwin13]
   /Users/zoulfiahall/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/socket.rb:232:
   in `getaddrinfo': getaddrinfo: nodename nor servname provided, 
   or not known  (SocketError)

If I use the following line of code in my terminal:

   Zoulfias-iMac:zoulfia zoulfiahall$ rails s -b 127.0.0.1 -e production
   => Booting WEBrick
   => Rails 4.2.0 application starting in production on http://127.0.0.1:3000
    => Run `rails server -h` for more startup options
    => Ctrl-C to shutdown server
  [2015-05-19 20:06:17] INFO  WEBrick 1.3.1
  [2015-05-19 20:06:17] INFO  ruby 2.2.0 (2014-12-25) [x86_64-darwin13]
  [2015-05-19 20:06:17] INFO  WEBrick::HTTPServer#start: pid=1009 port=3000

My app runs in production mode but errors are not saved in my log file and sunspot:sold engine, even though is running, doesn't affect my app. Why can't I use http://localhost:3000 ?

I have the line '127.0.0.1 localhost' in my /etc/host file. Is it to do with 'capistrano' or 'unicorn' gems? I uninstalled them to see whether I could start my server but with no success. Any help will be welcomed.

Upvotes: 1

Views: 3655

Answers (1)

MBJH
MBJH

Reputation: 1639

What I did:

  1. I went to Safari -- System Preferences -- Network -- Advanced-- DNS and deleted all DNS servers

enter image description here

  1. I restarted my NetBeansIDE
  2. Run my app.

    => Booting WEBrick

    => Rails 4.2.0 application starting in production on http://localhost:3000

    => Run rails server -h for more startup options

    => Ctrl-C to shutdown server

    [2015-05-20 10:02:03] INFO WEBrick 1.3.1

    [2015-05-20 10:02:03] INFO ruby 2.2.0 (2014-12-25) [x86_64-darwin13]

    [2015-05-20 10:02:03] INFO WEBrick::HTTPServer#start: pid=2103 port=3000

I hope someone will find my post useful.

Upvotes: 3

Related Questions