ruby 如何解决此错误时,试图运行rake服务器或rackup config.ru

aor9mmx1  于 2023-06-22  发布在  Ruby
关注(0)|答案(1)|浏览(98)

wairi@my-pc:~/Development/code/phase-3/phase-3-sinatra-with-active-record-post-patch-delete $bundle exec rake server [DEPRECATED] Bundler.with_clean_env已被弃用,转而支持Bundler.with_unbundled_env。如果您想要在最初加载bundler之前的环境,请使用Bundler.with_original_env(在/var/lib/gems/3.0.0/gems/rerun-0.14.0/lib/rerun/notification. rb:74调用)
十六:09:18 [重新运行]第3阶段-sinatra-with-active-record-post-patch-delete已启动16:09:18 [rerun]重新运行(31476)Phase-3-sinatra-with-active-record-post-patch-delete(31493)/var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/handler。rb:四十五:在/var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/server的pick': Couldn't find handler for: puma, thin, falcon, webrick. (LoadError) from /var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/handler.rb:60:in default '中。rb:三百三十四:在/var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/server中的logging_middleware'中的server' from /var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/server.rb:255:in块中。rb:413:in block in build_app' from /var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/server.rb:412:in reverse_each 'from/var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/server。rb:412:in build_app' from /var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/server.rb:422:in wrapped_app' from/var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/server。rb:三百一十二:在block in start' from /var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/server.rb:379:in handle_profiling中,来自/var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/server。rb:311:在start' from /var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/server.rb:168:in中,从/var/lib/gems/3.0.0/gems/rack-2.2.7/bin/rackup开始:5:在<top (required)>' from /usr/local/bin/rackup:25:in中,从/usr/local/bin/rackup加载':二十五:在`'
16:09:20 [rerun] Phase-3-sinatra-with-active-record-post-patch-delete Launch Failed 16:09:20 [rerun] Watching. for**/*.{rb,js,coffee,css,scss,sass,erb,html,haml,ru,yml,slim,md,feature,c,h} with Linux adapter ^[[A ^C 16:14:14 [rerun] Phase-3-sinatra-with-active-record-post-patch-delete stopping

  • 实际上,我意识到实验室在选择使用哪种宝石时有问题。我在gemfile中添加了gem 'thin',它工作了,你也可以试试`gem 'puma'*
bnl4lu3b

bnl4lu3b1#

Rack似乎无法找到合适的服务器处理程序来运行您的应用程序。验证Gemfile:确保您已将适当的服务器处理程序gem(例如,gem 'thin'或gem 'puma')添加到Gemfile并保存更改。
运行bundle install:在您的项目目录中执行命令bundle install,确保所有gem(包括服务器处理程序gem)都已安装。
重新启动终端或shell:如果您最近安装了服务器处理程序gem,那么最好重新启动您的终端或shell会话,以确保更改生效。

相关问题