You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

执行rake server或rackup config.ru时出现错误的解决方法

解决bundle exec rake server启动失败问题

遇到的错误现象

执行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)

随后出现导致服务启动失败的核心错误:

/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)

伴随完整调用栈输出,最终服务启动失败。

问题根源与解决方法

问题根源

Rack需要依赖指定的Web服务器gem才能启动服务,当前项目Gemfile中未包含puma、thin、falcon或webrick中的任意一个。

解决步骤

  1. 打开项目根目录下的Gemfile,添加以下任意一个Web服务器gem:
    • gem 'thin'
    • gem 'puma'
  2. 执行命令安装依赖:
    bundle install
    
  3. 重新运行启动命令:
    bundle exec rake server
    

服务即可正常启动。

内容的提问来源于stack exchange,提问作者karuhi wairi

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.18 14:02:06