gpt4 book ai didi

ruby-on-rails - 无法启动我的 Rails 服务器 [linux]

转载 作者:太空宇宙 更新时间:2023-11-04 04:54:36 24 4
gpt4 key购买 nike

从包含我的应用程序的目录运行 Rails 服务器命令时,我收到此错误消息:

=> 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
[2018-05-28 15:55:12] INFO WEBrick 1.3.1
[2018-05-28 15:55:12] INFO ruby 2.3.1 (2016-04-26) [x86_64-linux-gnu]
Exiting
/usr/lib/ruby/2.3.0/socket.rb:231:in `getaddrinfo': getaddrinfo: Name or service not known (SocketError)
from /usr/lib/ruby/2.3.0/socket.rb:231:in `foreach'
from /usr/lib/ruby/2.3.0/socket.rb:757:in `tcp_server_sockets'
from /usr/lib/ruby/2.3.0/webrick/utils.rb:65:in `create_listeners'
from /usr/lib/ruby/2.3.0/webrick/server.rb:134:in `listen'
from /usr/lib/ruby/2.3.0/webrick/server.rb:115:in `initialize'
from /usr/lib/ruby/2.3.0/webrick/httpserver.rb:47:in `initialize'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/rack-1.6.10/lib/rack/handler/webrick.rb:31:in `new'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/rack-1.6.10/lib/rack/handler/webrick.rb:31:in `run'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/rack-1.6.10/lib/rack/server.rb:287:in `start'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/railties-4.2.0/lib/rails/commands/server.rb:80:in `start'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:80:in `block in server'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `tap'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:75:in `server'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/railties-4.2.0/lib/rails/commands/commands_tasks.rb:39:in `run_command!'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/railties-4.2.0/lib/rails/commands.rb:17:in `<top (required)>'
from /home/jack/Desktop/Rails/MegsBlog/bin/rails:9:in `require'
from /home/jack/Desktop/Rails/MegsBlog/bin/rails:9:in `<top (required)>'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
from /home/jack/Desktop/Rails/MegsBlog/vendor/bundle/ruby/2.3.0/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /usr/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:68:in `require'
from /home/jack/Desktop/Rails/MegsBlog/bin/spring:15:in `<top (required)>'
from bin/rails:3:in `load'
from bin/rails:3:in `<main>'

最佳答案

尝试将 127.0.0.1 localhost 添加到 /etc/hosts 文件中。另外,始终使用 bundle -> bundle exec Rails server 运行 rails server 命令。

关于ruby-on-rails - 无法启动我的 Rails 服务器 [linux],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50569239/

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