I have correctly (or prbably not) installed passenger on apache 2. Rack works, but sinatra keeps giving 404's.
Here is what works:
config.ru:
#app = proc do |env|
return [200, { "Content-Type" => "text/html" }, "hello <b>world</b>"]
end
run app
Here is what works too:
Running the app.rb (see below) with ruby app.rb and then looki...
Hi All
I have a simple Sinatra proxy, which when an endpoint is called, will redirect to another endpoint on the same Sinatra proxy.
When I make a request with a header, the proxy doesn't seem to pass this header through to the second endpoint when the request redirects in the first. This is my code:
get '/first' do
# g...
I have a simple rack app that's designed to marshal data from Rackspace CloudFiles, however it doesn't seem to be working.
I'm a complete noob when it comes to rack, so I'm hoping someone can show me the follies of my ways.
require 'rubygems'
require 'cloudfiles'
class StreamingFile
def initialize(id)
user = "<CLOUDFILES USERNAM...
Okay, so I'm trying to set cookies using Ruby. I'm in a Rack environment. response[name]=value will add an HTTP header into the HTTP headers hash rack has. I know that it works.
But the following method of setting cookies doesn't work:
def set_cookie(opts={})
args = {
:name => nil,
:value => nil,
:expire...
rack.request.form_input isn't in my env variable--what's going on?
anyone??
...
Hi!
I want to run a simple application using Rack, FastCGI and Lighttpd, but I cannot get it working.
I get the following error:
/usr/lib/ruby/1.8/rack/handler/fastcgi.rb:23:in `initialize': Address already in use - bind(2) (Errno::EADDRINUSE)
from /usr/lib/ruby/1.8/rack/handler/fastcgi.rb:23:in `new'
from /usr/lib/ruby/1.8/rack/handl...
Say I have a Sinatra route ala:
put '/data' do
request.body.read
# ...
end
It appears that the entire request.body is read into memory. Is there a way to consume the body as it comes into the system, rather than having it all buffered in Rack/Sinatra beforehand?
I see I can do this to read the body in parts, but the entire body s...
I'm using Rack to try to implement "Remember Me" functionality in my Sinatra app.
I'm able to set the session cookie to expire when the session ends or in X seconds time but I'd like to do both.
For example, if a user has clicked "remember me" then I wish for their session to end after X seconds. Eg, my app.rb has a line that looks lik...
If I have a Ruby on Rails application running on my Apache shared server (with Mongrel), can I get it to launch/run another total separate Rack application?
Then could I possibly build a Rails app that manages other rails/rack apps? So it could tell what apps are running and start/stop them when I want. Or is each app trapped in it's ow...
Hi,
I'm new to Rack and try to get my head around it running Ruby on Rails 3.0.0.beta4.
I'm starting a Rack app in the config.ru file but would like to use a variable there that is stored in my database. Is it even possible to get a database value back before the application is loaded or am I missing the point completely?
I'm using th...
I'm trying to get a sinatra app as a subpath in my rails 3 app.
Specifically, the resque queuing system has a sinatra based web interface that I would like to have accessible through /resque on my usual rails app.
You can see the project here: http://github.com/defunkt/resque
I found some people talking about adding a rackup file and ...
What does a rack handler do exactly, i.e. can someone explain in pseudo-code the steps that a rack handler takes to deliver a result for a request?
...
Hi there,
Do you know if Rack was ported to Java? To be more specific, I am aware of jruby-rack but I am looking for a native Java (re)implementation of Rack, if any?!
Thank you in advance,
- florin
...
Why
Is there a reason Rack's request log by default outputs to stderr? If i'm not mistaken, the request log is Rack::CommonLogger which according to the RDoc:
forwards every request to an app given, and logs a line in the Apache common log format to the logger, or rack.errors by default.
Doesn't it make more sense to have an acces...
Hello,
I'm trying to install redmine and I have a problem with phusion-passenger. Installer fails on dependencies saying that rack is missing. I've investigated the code to check where it looks for it, but I've found a line:
require 'rack'
that is enclosed in what seems to be rubys try-catch block.
I've already installed rack through ...
I wrote a rack middleware for my rails that that does something based on the if the REQUEST_URI equals specific string.
However what I quickly found out was in my development environment, which is using WEBrick, is the server puts in the full url for the REQUEST_URI. On my production environment, which is on Heroku, it behaves like exp...
I'm writing a rack middleware component for a rails app that will need to conditionally set cookies. I am currently trying to figure out to set cookies. From googling around it seems like this should work:
class RackApp
def initialize(app)
@app = app
end
def call(env)
@status, @headers, @response = @app.call(env)
@r...
I want to have Rack serve a specific file with a specific content type. It's a .htc file and it needs to be served as text/x-component so that IE will recognize it. In apache I would just do
AddType text/x-component .htc
How can I achieve this with Rack? Currently the file is served by Rack::Static, but I didn't find an option to set ...
I am trying to find out how a gem in the Rails 3 gemfile can automatically add middleware to the Rack stack. I am looking for the hook in that gem.
For example ... when I add the devise gem to my Rails 3 gemfile, then devise somehow adds warden as middleware on the Rack stack. This seems to work automatically. There is no further configu...
Hi,
I got an error while uploading a file.
/!\ FAILSAFE /!\ 07/26/2010 02:37
Status: 500 Internal Server Error
bad content body
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/utils.rb:467:in `parse_multipart'
/usr/lib/ruby/gems/1.8/gems/rack-1.1.0/lib/rack/request.rb:268:in `parse_multipart'
/usr/lib/ruby/gems/1.8/gem...