gpt4 book ai didi

ruby-on-rails - rails 服务器无法启动; getaddrinfo : nodename nor servname provided, 或未知 (SocketError)

转载 作者:数据小太阳 更新时间:2023-10-29 07:21:38 24 4
gpt4 key购买 nike

我还没有找到解决问题的方法,但是几天前已经有人问过同样的问题 - ( Rails Server Keeps Exiting (SocketError) )

在我启动 Rails 服务器后,系统返回一些我无法理解的错误。为了在我的 Mac 上安装 Ruby on Rails,我做了所有列在 http://railsapps.github.io/installrubyonrails-mac.html 上的事情。

这是我的终端响应:

$ rails server
=> Booting WEBrick
=> Rails 4.2.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
=> Ctrl-C to shutdown server
[2015-02-28 02:14:46] INFO WEBrick 1.3.1
[2015-02-28 02:14:46] INFO ruby 2.2.0 (2014-12-25) [x86_64-darwin14]
Exiting
/Users/alexshel/.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)
from /Users/alexshel/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/socket.rb:232:in `foreach'
from /Users/alexshel/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/socket.rb:459:in `tcp_server_sockets'
from /Users/alexshel/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/utils.rb:70:in `create_listeners'
from /Users/alexshel/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/server.rb:133:in `listen'
from /Users/alexshel/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/server.rb:114:in `initialize'
from /Users/alexshel/.rvm/rubies/ruby-2.2.0/lib/ruby/2.2.0/webrick/httpserver.rb:45:in `initialize'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@global/gems/rack-1.6.0/lib/rack/handler/webrick.rb:32:in `new'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@global/gems/rack-1.6.0/lib/rack/handler/webrick.rb:32:in `run'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@global/gems/rack-1.6.0/lib/rack/server.rb:286:in `start'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@global/gems/railties-4.2.0/lib/rails/commands/server.rb:80:in `start'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@global/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@global/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@global/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@global/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@global/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from /Users/alexshel/workspace/myapp/bin/rails:8:in `require'
from /Users/alexshel/workspace/myapp/bin/rails:8:in `<top (required)>'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@myapp/gems/spring-1.3.3/lib/spring/client/rails.rb:27:in `load'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@myapp/gems/spring-1.3.3/lib/spring/client/rails.rb:27:in `call'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@myapp/gems/spring-1.3.3/lib/spring/client/command.rb:7:in `call'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@myapp/gems/spring-1.3.3/lib/spring/client.rb:26:in `run'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@myapp/gems/spring-1.3.3/bin/spring:48:in `<top (required)>'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@myapp/gems/spring-1.3.3/lib/spring/binstub.rb:11:in `load'
from /Users/alexshel/.rvm/gems/ruby-2.2.0@myapp/gems/spring-1.3.3/lib/spring/binstub.rb:11:in `<top (required)>'
from /Users/alexshel/workspace/myapp/bin/spring:13:in `require'
from /Users/alexshel/workspace/myapp/bin/spring:13:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'

请帮忙。

最佳答案

通过在private/etc/hosts文件中添加127.0.0.1 localhost记录解决了问题,该文件之前因故被删除。

关于ruby-on-rails - rails 服务器无法启动; getaddrinfo : nodename nor servname provided, 或未知 (SocketError),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28768934/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com