ruby-on-rails - 无法启动 Ruby on Rails 服务器
问题描述
$ rails s
=> Booting Puma
=> Rails 6.0.1 application starting in development
=> Run `rails server --help` for more startup options
*** SIGUSR2 not implemented, signal based restart unavailable!
*** SIGUSR1 not implemented, signal based restart unavailable!
*** SIGHUP not implemented, signal based logs reopening unavailable!
Puma starting in single mode...
* Version 4.3.0 (ruby 2.6.5-p114), codename: Mysterious Traveller
* Min threads: 5, max threads: 5
* Environment: development
Exiting
C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/binder.rb:229:in `initialize': Only one usage of each socket address (protocol/network address/port) is normally permitted. - bind(2) for "::1" port 3000 (Errno::EADDRINUSE)
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/binder.rb:229:in `new'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/binder.rb:229:in `add_tcp_listener'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/binder.rb:223:in `block in add_tcp_listener'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/binder.rb:222:in `each'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/binder.rb:222:in `add_tcp_listener'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/binder.rb:106:in `block in parse'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/binder.rb:90:in `each'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/binder.rb:90:in `parse'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/runner.rb:161:in `load_and_bind'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/single.rb:98:in `run'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/puma/launcher.rb:172:in `run'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/puma-4.3.0/lib/rack/handler/puma.rb:73:in `run'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/rack-2.0.7/lib/rack/server.rb:297:in `start'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/commands/server/server_command.rb:39:in `start'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/commands/server/server_command.rb:147:in `block in perform'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/commands/server/server_command.rb:138:in `tap'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/commands/server/server_command.rb:138:in `perform'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/command.rb:27:in `run'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor/invocation.rb:126:in `invoke_command'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/thor-0.20.3/lib/thor.rb:387:in `dispatch'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/command/base.rb:65:in `perform'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/command.rb:46:in `invoke'
from C:/Ruby26-x64/lib/ruby/gems/2.6.0/gems/railties-6.0.1/lib/rails/commands.rb:18:in `<top (required)>'
from bin/rails:4:in `require'
from bin/rails:4:in `<main>'
有我的错误信息。我试图按照 YouTube 教程制作 Ruby on Rails 网站。每次我这样做rails server
,它都会给我。
$ ruby -v
ruby 2.6.5p114 (2019-10-01 revision 67812) [x64-mingw32]
$ rails -v
Rails 6.0.1
解决方案
正如错误消息告诉您的那样,已经有其他东西在使用该地址(TCP [::1]:3000
)。您需要使用不同的地址或关闭正在使用该地址的任何其他地址。
推荐阅读
- mongodb - mongoDB如何更新多数组数据
- javascript - 如何循环运行我的 div 的全部内容?
- java - 使用 AlertDialog 中的上下文函数从 MainActivity 获取方法的问题
- wget - wget:抓取网页时保存URL
- python-3.x - 如何删除除括号和连字符(-)之外的所有特殊字符
- python-3.x - 在屏幕上放置一个 tkinter 标签几秒钟然后销毁它
- kubernetes - k8s/istio - 在 Envoy 不支持的情况下,服务之间的 HTTP 缓存的替代方案是什么?
- java - 错误:jdk-13.0.2 中不存在包 com.sun.javadoc
- java - 我怎样才能让这个代码打印一个数字中有多少个质数?
- android - 在 Kotlin 中使用协程 IO 线程时使用的主线程