代码之家  ›  专栏  ›  技术社区  ›  karuhi wairi

如何解决在尝试运行rake server或rackup config.ru时出现的错误

  •  0
  • karuhi wairi  · 技术社区  · 1 年前

    wairi@my-pc:~/开发/code/phase-3/phase-3-sintra-with-active-record-post-patch-delete$bundle-exec-rake服务器 [已弃用] Bundler.with_clean_env 已被否决而赞成 Bundler.with_unbundled_env 。如果您希望环境在最初加载bundler之前,请使用 Bundler.with_original_env (调用于/var/lib/gems/30.0/gems/rerun-0.14.0/lib/runun/notification.rb:74)

    16:09:18[重新运行]第三阶段-启动-主动记录-点击-删除 16:09:18[重新运行]重新运行(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:45:in中 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 默认值' 来自/var/lib/gems/30.0/gems/rack-2.2.7/lib/rack/server.rb:334:in server' from /var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/server.rb:255:in logging_middleware'中的块 来自/var/lib/gems/30.0/gems/rack-2.2.7/lib/rack/server.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 反向_每个' 来自/var/lib/gems/30.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 包装应用程序 来自/var/lib/gems/30.0/gems/rack-2.2.7/lib/rack/server.rb:312:in block in start' from /var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/server.rb:379:in 句柄_配置文件' 来自/var/lib/gems/30.0/gems/rack-2.2.7/lib/rack/server.rb:311:in start' from /var/lib/gems/3.0.0/gems/rack-2.2.7/lib/rack/server.rb:168:in 启动' 来自/var/lib/gems/30.0/gems/rack-2.2.7/bin/rackup:5:in <top (required)>' from /usr/local/bin/rackup:25:in 负载' 来自/usr/local/bin/rackup:25:in“”

    16:09:20[重新运行]第三阶段sinatra-with-active-record-post-patch-delete启动失败 16:09:20[重播]观看。用于**/*。{rb,js,coffee,css,scss,sass,erb,html,haml,ru,yml,slim,md,feature,c,h}带有Linux适配器 ^[阿^C 16:14:14[重新运行]第三阶段-带主动记录-点击-删除停止

    事实上,我意识到实验室在选择使用哪种宝石方面存在问题。我补充道 gem 'thin' 在gemfile中,它起作用了,你也可以试试“gem”puma

    1 回复  |  直到 1 年前
        1
  •  0
  •   karuhi wairi    1 年前

    Rack似乎无法找到合适的服务器处理程序来运行您的应用程序。 验证Gemfile:确保您已将适当的服务器处理程序gem(例如,gem“thin”或gem“puma”)添加到您的Gemfile并保存了更改。

    运行bundle-install:在项目目录中执行bundle-innstall命令,以确保所有gem(包括服务器处理程序gem)都已安装。

    重新启动终端或shell:如果您最近安装了服务器处理程序gem,那么最好重新启动您的终端或shell会话,以确保更改生效。