【问题标题】:start up issue -- getaddrinfo: nodename nor servname provided, or not known (SocketError)启动问题——getaddrinfo:提供节点名或服务名,或未知(SocketError)
【发布时间】:2015-07-31 19:22:32
【问题描述】:

我正在使用 NetBeans IDE 8、ruby-2.2.0-p0、mysql2、iMac、OS X 10.9.5

我正在尝试在生产模式下运行我的应用,我得到:

   => 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)

如果我在终端中使用以下代码行:

   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

我的应用程序在生产模式下运行,但错误不会保存在我的日志文件中,并且 sunspot:sold 引擎即使正在运行,也不会影响我的应用程序。 为什么我不能使用 http://localhost:3000 ?

我的 /etc/host 文件中有“127.0.0.1 localhost”行。 它与“capistrano”或“unicorn”宝石有关吗?我卸载了它们看看是否 我可以启动我的服务器但没有成功。 欢迎任何帮助。

【问题讨论】:

    标签: ruby-on-rails sockets localhost


    【解决方案1】:

    我做了什么:

    1. 我去了 Safari -- 系统偏好 -- 网络 -- 高级 -- DNS 和 删除所有 DNS 服务器

    1. 我重新启动了 NetBeansIDE
    2. 运行我的应用程序。

      => 启动 WEBrick

      => Rails 4.2.0 应用程序在 http://localhost:3000 开始生产

      => 运行 rails server -h 以获得更多启动选项

      => Ctrl-C 关闭服务器

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

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

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

    我希望有人会发现我的帖子有用。

    【讨论】:

      猜你喜欢
      • 2012-11-02
      • 1970-01-01
      • 2015-04-30
      • 2016-11-11
      • 2011-05-07
      • 2017-04-18
      • 2011-10-17
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多