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
3
votes
0 answers

Why Rails Server not working because of SSL?

I'm working on an app currently and I attempted to replace my webserver WEBrick with puma. The application is currently deployed with Heroku. Also, while doing this I wanted to be able to run my rails s with production. To my understanding, I would…
Nappstir
  • 995
  • 2
  • 20
  • 38
3
votes
1 answer

Simple Ruby "Hello, World" Program for Webrick Using Virtual Hosts

I searched the internet for a "Hello, World" type program for Webrick in Ruby, but could not find anything that worked. I found this guide on SO but for the life of me could not get it to work. Consulting the Ruby Documentation for Webrick led me to…
pmagunia
  • 1,718
  • 1
  • 22
  • 33
3
votes
0 answers

How to make WEBrick work only over HTTPS/TLS1.2 to avoid POODLE?

I was looking at the code here: How to make Sinatra work over HTTPS/SSL? require 'sinatra/base' require 'webrick' require 'webrick/https' require 'openssl' CERT_PATH = '/opt/myCA/server/' webrick_options = { :Port => 8443, …
user1781482
  • 623
  • 3
  • 15
  • 24
3
votes
2 answers

WEBrick & Sinatra: how to redirect all http traffic to https

I have a tried to set up a very simple Sinatra and Webrick server working over https with a self signed certificate. I would like to redirect all http traffic to https, is this possible in this setup? I have two Ruby files as…
Aly
  • 15,865
  • 47
  • 119
  • 191
3
votes
1 answer

Error when trying to start Webrick on Ubuntu 14.04

this is the output I get when using the 'rails server' the page does also not load when trying to access it through Google Chrome, this is on a virtual machine => Booting WEBrick => Rails 4.1.7 application starting in development on http:…
Elasticy
  • 31
  • 1
3
votes
3 answers

Adding PUT/DELETE to Ruby WEBrick

I'm trying to add PUT and DELETE verbs to WEBrick. I don't need them to do anything. They just need to respond with a 200. Below is the script I am running. GET works, but DELETE returns 405 with a "unsupported method DELETE" message. Can…
Kent
  • 1,691
  • 4
  • 19
  • 27
3
votes
2 answers

How can I execute Ruby code with WEBrick instead of dumping the code to my browser?

I'm facing a problem when I run my program in a browser with the WEBrick server. It shows me my code as written in the 2loop.rb file. When I run ruby -run -e -httpd. -p 5000 at the command prompt, and load http://localhost:5000/2loop.rb in the…
Harman
  • 1,703
  • 5
  • 22
  • 40
3
votes
0 answers

Run rails Webrick server from Sublime Text 3 using a custom Build System

I'm trying to create a build system which will run the following command: rails server Within the project's directory. I have tried the following which seems to make the build take around 5 seconds, but nothing is output and no errors show. When I…
Stefan Dunn
  • 5,363
  • 7
  • 48
  • 84
3
votes
2 answers

Rails' script/server for a PHP project

Is there a simple HTTP server that can be run in the current PHP project path, like Rails' script/server (webrick)?
user217782
3
votes
1 answer

WEBrick::HTTPStatus::LengthRequired with Twilio

Following the tutorial for Twilio Client. Got stuck here where you do the testing https://www.twilio.com/docs/quickstart/ruby/client/incoming-calls curl -X POST http://localhost:3000/voice I keep getting the WEBrick::HTTPStatus::LengthRequired…
Mohamed El Mahallawy
  • 13,024
  • 13
  • 52
  • 84
3
votes
2 answers

WEBrick: log POST data

I'm running a simple WEBrick server to debug POST data. I'd like to output the POST data to the log. My code is: server.mount_proc '/' do |req, res| res.body = "Web server response:\n" # Output POST data here... end where server is simply a…
Snowcrash
  • 80,579
  • 89
  • 266
  • 376
3
votes
2 answers

Why won't my css changes show without me restarting WEBrick?

I am doing some simple css edits on a rails 3.2 project and my changes will not show up unless I restart webrick. I came across something saying that it may be using the public/assets directory, but I don't think this is the case because my changes…
Spencer Cooley
  • 8,471
  • 16
  • 48
  • 63
3
votes
2 answers

Rails WEBrick not writing log to terminal (stdout)

WEBrick usually writes its output to both development.log and stdout. However it suddenly stopped doing so and it is not writing to stdout. All we're getting is Booting WEBrick => Rails 3.2.8 application starting in development on…
boulder
  • 3,256
  • 15
  • 21
3
votes
2 answers

Webrick and Apache in one server

I have a server that runs an Apache server on port 80 and a Webrick web-apps on port 9090. Whenever I stop the Webrick server by killing the process using kill -9 12345, where 12345 is the PID of Webrick, I cannot restart the web-apps again since…
Herry
  • 455
  • 3
  • 14
3
votes
1 answer

WEBrick rails server verbosity

Is there a way to start the WEBrick server with no verbosity. I feel like it logs too much information. For example: rails s --verbose=false
Dillon Benson
  • 4,280
  • 4
  • 23
  • 25