webrick

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

时光毁灭记忆、已成空白 提交于 2019-12-02 20:52:02
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 start a server (i use webrick) and then run the specs after executing the specs it should kill the webrick so i'm not left with some unused background process webrick is not a requirement, but it's included in the ruby standard library so being able to use it would be great. hope anyone is able to help! ps. i'm running on linux, so having this work for

Why would I want to use unicorn or thin instead of WEBrick for development purposes?

◇◆丶佛笑我妖孽 提交于 2019-12-02 17:01:16
I've recently found that some people prefer using unicorn_rails instead of the default WEBrick as a web server for developing Rails applications. I understand that if I wanted to use unicorn in production, it could make kind of sense to try it out in development, but since the configuration is different in production, is it even relevant? Is there any real, tangible advantage that I would get from using thin or unicorn instead of WEBrick for developing a Rails application, such as speed or some additional features? Or is this just a matter of personal preference? It is important to develop as

Installed Ruby on Rails but when I try to run Rails Sever it doesn't load WEBrick?

三世轮回 提交于 2019-12-01 12:48:17
I installed Ruby on Rails on my mac today along with Gems and MYsql. I'm trying to follow the lynda.com tutorial and I've run into a brick wall. When I try to run the rails server it doesnt load WEBrick for some reason. This is the error I get: /Library/Ruby/Gems/1.8/gems/railties-3.0.5/lib/rails/script_rails_loader.rb:11: warning: Insecure world writable dir /usr/local in PATH, mode 040777 /Library/Ruby/Gems/1.8/gems/bundler-1.0.10/lib/bundler/runtime.rb:136: warning: Insecure world writable dir /usr/local in PATH, mode 040777 /Library/Ruby/Gems/1.8/gems/mysql2-0.2.6/lib/mysql2/mysql2.bundle:

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

不问归期 提交于 2019-12-01 03:23:04
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 => File.expand_path("tmp/pids/server.pid"), :config => File.expand_path("config.ru"), :SSLEnable => true, :SSLVerifyClient => OpenSSL::SSL::VERIFY_NONE, :SSLPrivateKey => OpenSSL::PKey::RSA.new( File.open("certificates/https/key.pem").read), :SSLCertificate => OpenSSL::X509::Certificate.new( File.open("certificates/https/cert.pem").read), :SSLCertName => [["CN", WEBrick::Utils:

Disabling echo from webrick

陌路散爱 提交于 2019-12-01 02:45:38
How can I disable messages from webrick echoed on to the terminal? For the INFO messages that appear at the beginning, I was able to disable it by setting the Logger parameter so as: s = WEBrick::HTTPServer.new( Port: 3000, BindAddress: "localhost", Logger: WEBrick::Log.new("/dev/null"), ) But I further want to disable the messages that look like: localhost - - [17/Jun/2011:10:01:38 EDT] "GET .... HTTP/1.1" 200 0 http://localhost:3000/ -> ..... when a request is made from the web browser. Following the link to the source and suggestion provied by Yet Another Geek, I was able to figure out a

Disabling echo from webrick

假如想象 提交于 2019-11-30 22:34:59
问题 How can I disable messages from webrick echoed on to the terminal? For the INFO messages that appear at the beginning, I was able to disable it by setting the Logger parameter so as: s = WEBrick::HTTPServer.new( Port: 3000, BindAddress: "localhost", Logger: WEBrick::Log.new("/dev/null"), ) But I further want to disable the messages that look like: localhost - - [17/Jun/2011:10:01:38 EDT] "GET .... HTTP/1.1" 200 0 http://localhost:3000/ -> ..... when a request is made from the web browser. 回答1

Configure WEBrick to use automatically generated self-signed SSL/HTTPS certificate

我怕爱的太早我们不能终老 提交于 2019-11-30 12:37:15
I want to develop my Ruby on Rails application locally with SSL/HTTPS, but I'm having trouble trying to setup a server to use SSL. The following are the things I've already tried so far: rails server [options] The rails server command doesn't come with an ssl option ( rails server --help ): Usage: rails server [mongrel, thin, etc] [options] -p, --port=port Runs Rails on the specified port. Default: 3000 -b, --binding=ip Binds Rails to the specified ip. Default: 0.0.0.0 -c, --config=file Use custom rackup configuration file -d, --daemon Make server run as a Daemon. -u, --debugger Enable the

We're sorry, but something went wrong. - with Rails, Apache, Passenger

与世无争的帅哥 提交于 2019-11-30 04:38:46
I have Rails 3.2.3 with Apache and Passenger . I have a project working in development mode. When I switch the project to production mode ( Passenger standard) it gives me an HTTP Error 500 : We're sorry, but something went wrong. This happens even with WEBrick . Can somebody help me? Edit : My production environment file: http://pastebin.com/ZAudSzkc dennis Make sure you have ran $ bundle install . If this doesn't succeed, go to your production environment and connect to your server using ssh and $ tail -f log/production.log in your current production app. This will generate an output which

can't open rails server

為{幸葍}努か 提交于 2019-11-30 00:33:06
I don't know what I did. I think I updated my Ruby on Rails. After updating it, I always get error when running $rails server. output is ruby-1.9.2-p290/lib/ruby/1.9.1/webrick/utils.rb:73:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE) I would restart the console and run rails server and it would work fine for a couple of minutes but then it would stop responding and if I restart rails server it would give me that error again. I tried running on different port (rails s -p 9191) and it gives me the same problem. Any Ideas what I did wrong? Thnx guys run it on other port:

Ruby Sinatra Webservice running on localhost:4567 but not on IP

做~自己de王妃 提交于 2019-11-29 22:58:39
I have a ruby(using sinatra) webservice on windows 7 32 bit OS. Its running on port 4567. Its working fine when I use localhost:4567 but when I replace localhost with the local ip of my machine say, 192.168.103.99:4567 it doesn't work, and fails to connect. I have already disabled the firewall, by-pass proxy and added port 4567 to exception, still no luck. What might be the issue ? From the comment of @SudarshanShubakar following worked for me. ruby app.rb -o 0.0.0.0 When using the built-in server through the run! if app_file == $0 check, Sinatra's doc explains that set :bind, '0.0.0.0' is