Ruby on rails can';t启动rails服务器(错误的URI(不是URI?):tcp://localhost:5000:3000)

Ruby on rails can';t启动rails服务器(错误的URI(不是URI?):tcp://localhost:5000:3000),ruby-on-rails,ruby-on-rails-5,puma,Ruby On Rails,Ruby On Rails 5,Puma,创建新的rails项目并通过键入rails s启动服务器时,每次都会崩溃。我创建了一个新项目,并尝试运行rails s,如下所示: rails s => Booting Puma => Rails 5.2.1 application starting in development => Run `rails server -h` for more startup options Puma starting in single mode... * Version 3.12.0

创建新的rails项目并通过键入
rails s
启动服务器时,每次都会崩溃。我创建了一个新项目,并尝试运行
rails s
,如下所示:

rails s 
=> Booting Puma
=> Rails 5.2.1 application starting in development 
=> Run `rails server -h` for more startup options
Puma starting in single mode...
* Version 3.12.0 (ruby 2.5.1-p57), codename: Llamas in Pajamas
* Min threads: 5, max threads: 5
* Environment: development
Exiting
Traceback (most recent call last):
40: from bin/rails:3:in `<main>'
39: from bin/rails:3:in `load'
38: from /media/se7a/1C40A4ED40A4CEB8/temp_rails_projec/bin/spring:15:in `<top (required)>'
37: from /media/se7a/1C40A4ED40A4CEB8/temp_rails_projec/bin/spring:15:in `require'
36: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `<top (required)>'
35: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in `load'
34: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/bin/spring:49:in `<top (required)>'
33: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client.rb:30:in `run'
32: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/command.rb:7:in `call'
31: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `call'
30: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in `load'
29: from /media/se7a/1C40A4ED40A4CEB8/temp_rails_projec/bin/rails:9:in `<top (required)>'
28: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `require'
27: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:253:in `load_dependency'
26: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.1/lib/active_support/dependencies.rb:287:in `block in require'
25: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:29:in `require'
24: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:20:in `require_with_bootsnap_lfi'
23: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/loaded_features_index.rb:65:in `register'
22: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `block in require_with_bootsnap_lfi'
21: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load_path_cache/core_ext/kernel_require.rb:21:in `require'
20: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/commands.rb:18:in `<main>'
19: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/command.rb:46:in `invoke'
18: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/command/base.rb:65:in `perform'
17: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/thor-0.20.0/lib/thor.rb:387:in `dispatch'
16: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/thor-0.20.0/lib/thor/invocation.rb:126:in `invoke_command'
15: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/thor-0.20.0/lib/thor/command.rb:27:in `run'
14: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:142:in `perform'
13: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:142:in `tap'
12: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:147:in `block in perform'
11: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:53:in `start'
10: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/rack-2.0.5/lib/rack/server.rb:297:in `start'
 9: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/rack/handler/puma.rb:70:in `run'
 8: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/launcher.rb:184:in `run'
 7: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/single.rb:96:in `run'
 6: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/runner.rb:151:in `load_and_bind'
 5: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/binder.rb:88:in `parse'
 4: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/binder.rb:88:in `each'
 3: from /home/se7a/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/binder.rb:89:in `block in parse'
 2: from /home/se7a/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/common.rb:237:in `parse'
 1: from /home/se7a/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/rfc3986_parser.rb:73:in `parse'
/home/se7a/.rvm/rubies/ruby- 
 2.5.1/lib/ruby/2.5.0/uri/rfc3986_parser.rb:67:in `split': bad URI(is not URI?): tcp://localhost:5000:3000 (URI::InvalidURIError)
rails
=>引导美洲狮
=>Rails 5.2.1应用程序开始开发
=>运行“rails服务器-h”以获得更多启动选项
Puma在单一模式下启动。。。
*版本3.12.0(ruby 2.5.1-p57),代号:穿着睡衣的骆驼
*最小线程数:5,最大线程数:5
*环境:发展
退出
回溯(最近一次呼叫最后一次):
40:从箱子/轨道:3:in`'
39:来自料仓/轨道:3:在“装载”中
38:from/media/se7a/1C40A4ED40A4CEB8/temp\u rails\u projec/bin/spring:15:in`'
37:from/media/se7a/1C40A4ED40A4CEB8/temp_rails_projec/bin/spring:15:in'require'
36:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in`'
35:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/binstub.rb:31:in'load'
34:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/bin/spring:49:in`'
33:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client.rb:30:in'run'
32:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/command.rb:7:in'call'
31:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in'call'
30:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/spring-2.0.2/lib/spring/client/rails.rb:28:in'load'
29:from/media/se7a/1C40A4ED40A4CEB8/temp\u rails\u projec/bin/rails:9:in`'
28:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.1/lib/active\u-support/dependencies.rb:287:in'require'
27:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.1/lib/active\u support/dependencies.rb:253:in'load\u dependencity'
26:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/activesupport-5.2.1/lib/active\u-support/dependencies.rb:287:in'block in require'
25:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load\u path\u cache/core\u ext/kernel\u require.rb:29:in'require'
24:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load\u path\u cache/core\u ext/kernel\u require.rb:20:in“require\u with\u bootsnap\u lfi”
23:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load\u path\u cache/loaded\u features\u index.rb:65:in`register'
22:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load\u path\u cache/core\u ext/kernel\u require.rb:21:in`block in require_with_bootsnap\u lfi'
21:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/bootsnap-1.3.2/lib/bootsnap/load\u path\u cache/core\ext/kernel\u require.rb:21:in'require'
20:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/commands.rb:18:in`'
19:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/command.rb:46:in“invoke”
18:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/command/base.rb:65:in'perform'
17:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/thor-0.20.0/lib/thor.rb:387:in'dispatch'
16:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/thor-0.20.0/lib/thor/invocation.rb:126:in“invoke_命令”
15:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/thor-0.20.0/lib/thor/command.rb:27:in'run'
14:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:142:in“perform”
13:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:142:in'tap'
12:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:147:in'block in perform'
11:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/railties-5.2.1/lib/rails/commands/server/server_command.rb:53:in'start'
10:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/rack-2.0.5/lib/rack/server.rb:297:in“开始”
9:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/rack/handler/puma.rb:70:in'run'
8:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/launcher.rb:184:in'run'
7:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/single.rb:96:in'run'
6:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/runner.rb:151:in'load_and_bind'
5:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/binder.rb:88:in'parse'
4:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/binder.rb:88:in'each'
3:from/home/se7a/.rvm/gems/ruby-2.5.1/gems/puma-3.12.0/lib/puma/binder.rb:89:in'block in parse'
2:from/home/se7a/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/common.rb:237:in'parse'
1:from/home/se7a/.rvm/rubies/ruby-2.5.1/lib/ruby/2.5.0/uri/rfc3986_parser.rb:73:in'parse'
/home/se7a/.rvm/rubies/ruby-
2.5.1/lib/ruby/2.5.0/uri/rfc3986_parser.rb:67:in'split':错误的uri(不是uri?):tcp://localhost:5000:3000 (URI::InvalidURIError)

-检查您的url是否为零,是否有效。 -在URI.parse之前执行URI.encode(url)(以避免特殊字符) -对传递给URI.parse的字符串执行strip(以避免前导和尾随空格)。 一应俱全:

uri = URI.parse(URI.encode(url.strip))

请尝试localhost:3000而不是localhost:5000:3000无效。我可以查看您的config/puma.rb文件吗?