Questions tagged [rack]

Rack provides a minimal interface between webservers supporting Ruby and Ruby frameworks.

Rack is a minimal, modular and adaptable interface for developing web applications in Ruby. By wrapping HTTP requests and responses in the simplest way possible, it unifies and distills the API for web servers, web frameworks, and software in between (the so-called middleware) into a single method call.

Useful Links

1617 questions
0
votes
3 answers

Sinatra/Rack Sleep until Response Ready (like Exchange ActiveSync)

I'm wanting to do a lightweight push-style HTTP response in my existing Sinatra web app. Is there any mechanism that allows me to not respond to an HTTP request and keep the connection open until I wake up the connection at a future time?
Ecton
  • 10,702
  • 2
  • 35
  • 44
0
votes
1 answer

When is this Rack::Protection::FormToken a security issue?

The header comment for Rack::Protection::FormToken says: # This middleware is not used when using the Rack::Protection collection, # since it might be a security issue, depending on your application Can anyone describe an example of when this…
dgo.a
  • 2,634
  • 23
  • 35
0
votes
1 answer

RegexpError: Stack overflow in regexp matcher : /\A(?:%[0-9a-fA-F]{2}|[^%])*\z/

We have small Sinatra application which runs on REE 1.8.7p-358 NewRelic reports some issues like this: RegexpError: Stack overflow in regexp matcher: /\A(?:%[0-9a-fA-F]{2}|[^%])*\z/ .../gems/rack-1.4.1/lib/rack/backports/uri/common_18.rb: 67:in…
Sergey Potapov
  • 3,819
  • 3
  • 27
  • 46
0
votes
2 answers

Single server instance for multiple Ruby (rails/sinatra) applications

In PHP I could have single php-fpm instance to serve multiple sites. The nginx config I had was looking like so: upstream backend { server 127.0.0.1:9000; } # site 1 server { server_name www.site1.com; root /var/www/site1; location ~…
Stas S
  • 1,022
  • 1
  • 8
  • 18
0
votes
1 answer

Rails, error in rack gem

I am assuming I have a rack issue but not sure where? I keep getting this when I launch my server: => Booting WEBrick => Rails 4.0.0 application starting in development on http://0.0.0.0:3000 => Run `rails server -h` for more startup options =>…
DAS2014
  • 65
  • 5
0
votes
1 answer

Priority among route patterns

I have the thin server running (without any web application framework). In the routing pattern, the order of matching patterns does not seem to make difference. Whether I do: Rack::Handler::Thin.run(Rack::Builder.new do map("/"){...} …
sawa
  • 165,429
  • 45
  • 277
  • 381
0
votes
1 answer

How to use ruby thin with CGI scripts?

I've written some ruby CGI scripts (using the Ruby CGI class) that I serve from my production server using lighttpd. I want to test them on my development server using thin. Basically, I want to drop all my CGI scripts in a directory and start thin…
0
votes
1 answer

Do I need gaps in a pile of rack servers with no rack cabinet?

I have seen Do I need to leave gaps in a standard server rack? and my question is similar but different: I have several rack servers (DELL 2850 mostly) but do not have a rack structure. Can I simply put one server on the top of another without…
user1156544
  • 1,725
  • 2
  • 25
  • 51
0
votes
1 answer

Maximum connections count on puma server

Is this possible to specify maximum connection on puma wev server (like in thin etc?). I need to test if this is reason of 502 that comes on some configuration with nginx+puma.
Sławosz
  • 11,187
  • 15
  • 73
  • 106
0
votes
1 answer

Very strange 'stack level too deep' problems on 'bootstrap' related gems

I've been stuck on this error for weeks. When I trying to include bootstrap gems in my application.css file, it MIGHT give the error of "Stack level too deep" From what I googled pointed out the root issue of this was because of double defined…
Jason Lu
  • 31
  • 3
0
votes
1 answer

Ruby variable scope: access rack.env from inside an existing ruby class?

I have a simple class: class Repository class << self def find(id) ... end end end It is called like this throughout our app: thing = Repository.find("abc") We are in a Sinatra/rack environment. During the request phase we do…
Steve Macdonald
  • 1,745
  • 2
  • 20
  • 34
0
votes
1 answer

does a ruby on rails rack class get access to the entire rails environment?

that is when the def call(env) method is invoked by hitting any url, can I inside that method make some ActiveRecord queries, use classes defined in lib, etc. etc. Or is it more like an irb console without the rails env loaded? Another way to put…
Andrew Arrow
  • 4,248
  • 9
  • 53
  • 80
0
votes
1 answer

Selective Loading using Rack

I am a complete noob to rack. I have 2 sinatra classes engine_a.rb and engine_b.rb Want to pass the rackoptions using ru file like $ rackup config.ru -O engine=a I want to use a selective loading using rack similar to the following require…
Saurajeet
  • 1,088
  • 2
  • 8
  • 10
0
votes
1 answer

How to test a Rack::Directory serving static files with Capybara? or How to test Rack Middleware with Capybara?

I'm using Rack::Directory.new to map a directory in the public folder directly to the website and serve static files. My config.ru contains: map '/pdfs/' do run Rack::Directory.new('./public/resources/pdfs') end require './app/main.rb' run…
Rebel Warrior
  • 91
  • 1
  • 3
0
votes
2 answers

How do I 'expire' sessions in Sinatra?

I sign in by storing their ID in session[user]. I don't want users to be signed in from one account on multiple devices. I want the site to expire other sessions for the user, when he signs in. How do I do that?
Dmitry
  • 2,068
  • 2
  • 21
  • 30
1 2 3
99
100