Questions tagged [webrick]

Webrick is a zero-configuration HTTP server stack chiefly used as the web server for the Ruby on Rails framework development and test environments.

WEBrick is an HTTP server toolkit that can be configured as an HTTPS server, a proxy server, and a virtual-host server. WEBrick features complete logging of both server operations and HTTP access.

A WEBrick server can be composed of multiple WEBrick servers or servlets to provide differing behavior on a per-host or per-path basis. WEBrick includes servlets for handling CGI scripts, ERb pages, ruby blocks and directory listings.

WEBrick also includes tools to run a process as a service and starting a process at a higher privilege level and dropping permissions.

From the version of ruby 1.9.1 Webrick is a part of ruby standard library. More info is on ruby docs. Sources for an older ruby version is on github.

523 questions
13
votes
1 answer

How do you choose your HTTP server in Sinatra?

I am running a Sinatra application locally. Ever since I installed Thin, my Sinatra app always uses it as the web server. However, I have been having performance issues with Thin serving the large amount of static files required by my application,…
sffc
  • 6,186
  • 3
  • 44
  • 68
11
votes
2 answers

Start webrick in port 80 (mysql2 gem issue)

I am trying to get my webrick serve in port 80. I tried: rails server -p 80 but get a access denied. I later understood that using port 1-1024 needs a root permission, so I tried this instead sudo rails server -p 80 However, now i get a mysql2…
Howard Huang
  • 355
  • 1
  • 4
  • 9
10
votes
2 answers

How do I configure WEBrick to use an intermediate certificate with HTTPS?

I am currently using the following options in my Rails app to enable HTTPS with WEBrick: { :Port => 3000, :environment => (ENV['RAILS_ENV'] || "development").dup, :daemonize => false, :debugger => false, :pid =>…
YWCA Hello
  • 2,997
  • 4
  • 29
  • 40
10
votes
2 answers

Heroku, Thin and everything in between

Looking at the logs, my cedar app currently runs webrick. Obviously, this is not the best choice for production app. As noted all over the web, I should use Thin webserver. But I would still like to use the simplicty of webrick on my development…
Nick Ginanto
  • 31,090
  • 47
  • 134
  • 244
10
votes
2 answers

How to enable SSL for a standalone Sinatra app?

I want to write a quick server app in Sinatra. It has to be self-contained (i.e. not use apache/nginx/passenger) but also has to support SSL. Is there an easy way to enable SSL support for Sinatra (using WEBRick for example)?
Jacob
  • 22,785
  • 8
  • 39
  • 55
9
votes
1 answer

What are the differences between using `rails server` and `rackup`?

The only difference I've noted is that rails server starts the server on port 3000, while rackup starts the server on port 9292. Are there any other differences? Are there use cases for one instead of the other?
Colin Dean
  • 1,429
  • 1
  • 15
  • 26
9
votes
4 answers

Why do I get "cache: [GET /] miss" in production using WebRick?

I cannot test my website in production mode using WebRick, as it is raising cache errors. In development and testing modes everything works perfectly. I have set this option in config/environments/production.rb: config.serve_static_assets =…
David Morales
  • 17,816
  • 12
  • 77
  • 105
9
votes
3 answers

How do you run Rails with HTTPs locally for testing?

Our dev envs use HTTP, prod uses HTTPS, this is causing issues that we can't reproduce locally with are HTTPS related. How can I run rails with SSL locally for testing purposes? Is there a Webrick config? Thanks
AnApprentice
  • 108,152
  • 195
  • 629
  • 1,012
9
votes
4 answers

Is a new instance of sinatra started on every request?

When a new http request comes in, will a new instance of sinatra be started, e.g. has sinatra to be initialized, or is just the method of a previous instance (the corresponding get/post method/route) of sinatra be called? Thank you for any…
user562529
  • 931
  • 1
  • 11
  • 19
9
votes
1 answer

Why does my WEBrick server get killed?

I've got a rails development environment running in DigitalOcean on Ubuntu 12.04, but my WEBrick process keeps getting "killed" after a couple of hours. I haven't been able to find any settings or configuration that would cause this. Example Console…
adamb0mb
  • 1,401
  • 1
  • 12
  • 15
9
votes
1 answer

Rails 500 server error: undefined method 'formats' for "index":string

I'm getting a 500 server error in my new rails app. The weird thing is that if you restart the rails server (I'm using the default webrick), the first request after reload is perfectly fine. Every subsequent request, however, returns this 500…
9
votes
3 answers

how to controller (start/kill) a background process (server app) in ruby

i'm trying to set up a server for integration tests (specs actually) via ruby and can't figure out how to control the process. so, what i'm trying to do is: run a rake task for my gem that executes the integration specs the task needs to first…
rubiii
  • 1,926
  • 2
  • 12
  • 8
8
votes
3 answers

WEBrick: RequestURITooLarge: should I update or use a different server?

I currently have: $ 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 …
AnApprentice
  • 108,152
  • 195
  • 629
  • 1,012
8
votes
4 answers

Jekyll ERROR Errno::ECONNRESET: Connection reset by peer @ io_fillbuf - fd:17

I'm getting the following error in my console logs when running the bundle exec jekyll command. [2020-01-29 15:34:01] ERROR Errno::ECONNRESET: Connection reset by peer @ io_fillbuf - fd:16 …
Andres Urdaneta
  • 431
  • 4
  • 15
8
votes
3 answers

Webrick and Thin are really slow serving static files in Windows. How can I speed them up?

I'm currently developing a web-app, and I alternate between Windows and Mac dev machines for this. My problem is that pages render extremely slowly on Windows, but it's not my Ruby code running slowly, but rather that static files are getting served…
Daniel Magliola
  • 30,898
  • 61
  • 164
  • 243
1 2
3
34 35