WEBrick:RequestURITooLarge:我应该更新还是使用其他服务器? [英] WEBrick: RequestURITooLarge: should I update or use a different server?

查看:80
本文介绍了WEBrick:RequestURITooLarge:我应该更新还是使用其他服务器?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前有:

$ rails s
=> Booting WEBrick
=> Rails 3.0.9 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
[2011-11-30 13:18:00] INFO  WEBrick 1.3.1
[2011-11-30 13:18:00] INFO  ruby 1.9.2 (2011-02-18) [x86_64-darwin10.8.0]
[2011-11-30 13:18:00] INFO  WEBrick::HTTPServer#start: pid=4204 port=3000

我遇到的问题是我正在使用openID进行身份验证并收到以下错误:

The problem I'm having is I'm using openID for auth and getting the following error:

[2011-11-30 13:18:19] ERROR WEBrick::HTTPStatus::RequestURITooLarge

在浏览器中:

Request-URI Too Large
WEBrick::HTTPStatus::RequestURITooLarge
WEBrick/1.3.1 (Ruby/1.9.2/2011-02-18) at macbook-pro.local:3000

我该如何解决?我可以更新WEBrick还是真的需要使用其他Web服务器?

How can I fix this? Can I update WEBrick or do I really need to use a different web server?

谢谢

推荐答案

在Ruby 1.9.3中.来源,它说MAX_URI_LENGTH =2083.这意味着最新版本的Webrick无法处理更长的URL.这就是WEBrick :: HTTPStatus :: RequestURITooLarge异常告诉您的内容.

In Ruby 1.9.3. source, it says that MAX_URI_LENGTH = 2083. That means that the latest version of Webrick can't handle urls longer that this. And that's what the WEBrick::HTTPStatus::RequestURITooLarge exception is telling you.

因此,解决方案是使用其他Web服务器.最喜欢的一种是Thin:

The solution therefore is to use a different web server. One of the most favourite ones is Thin:

sudo gem install thin

cd to/your/rails/app

thin -h

thin -a localhost start

这篇关于WEBrick:RequestURITooLarge:我应该更新还是使用其他服务器?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆