rack

How to build my own rack preview like sinatra - staticmatic

Hi Guys I have HAML SASS converter and want to allow users the localhost:30000 functionality i guess to view their HAML SASS files in the browsers. Any guides you know that might help me? Thanks ...

Camping's URL() doesn't give me "site root" as expected?

Due to circumstances beyond my control, my production Camping site appears at mysite.example.com/mysite. I'm pretty sure this is a common Apache / Passenger configuration issue, and I'm not interested in how to fix it right now because the server is out of my control. Suffice to say, the controller for "/" points there and I can't chan...

Rack @app.call REQUEST_URI not honored in rails 2.3.9

Hi, I wrote a Rack Middleware which analyse response to find esi:include tags, clone the rack env, set a new PATH_INFO and REQUEST_URI (according to tag's src attribute) then @app.call with the new env. It proceed well, but Rails (2.3.9) doesn't seem to recognize the completely the route (request_uri: "/esi/audience"), as it fallback ...

Ruby Rack issue

I am newbie to Ruby on Rails This is what happened I got a hosting from bluehost which supports RoR. I download a Rack-based open-source web font server. I copied that to my hosting domain. I tried to startup that server using rackup filename.ru, but rackup is not avaliable... what 2 do now How to start this server. ...

Writing ruby web-service. What architecture should I use? Rack, Rails-engine?

I need to write web-service that will get files over http and convert them. This service in future might be included in rails application. I wonder what I need to use for that? Mount as Rack-middleware? Sinatra app? Write Rails-engine? Simple ruby script with networking? Anything else? Thanks ...

Rack session key too long for memcached

I am running Rails 3 configured to use memcached for session store. I have the following setup: development.rb config.cache_store = :mem_cache_store session_store.rb Foo::Application.config.session_store :mem_cache_store, :key => '_foo_session' I can start the app fine, when I go to any page I get the following error: ArgumentError...

Rack Error with DreamHost, Passenger, and Rails 3.0.0.rc

Background: I have viewed this question as well as this one - sadly, to no avail. Error Message (Passenger): You have already activated rack 1.1.0, but your Gemfile requires rack 1.2.1. Consider using bundle exec. my Gemfile: source 'http://rubygems.org' gem 'rails', '3.0.0.rc' gem 'nifty-generators' gem 'nokogiri' group :after_ini...

Passenger Rack app 'cannot infer basepath'

I have a simple config.ru file for my Sinatra app. require 'sinatra' require 'app' run Sinatra::Application However, Passenger is failing with the error no such file to load -- app. I've tried using the 1.9 method require_relative but that now causes the error cannot infer basepath. I'm currently using the very hacky require File.jo...

Ruby Rack - mounting a simple web server that reads index.html as default

Hello, I'm trying to get some information from this tutorial: http://m.onkey.org/2008/11/18/ruby-on-rack-2-rack-builder basically I want to have a file config.ru that tell rack to read the current directory so I can access all the files just like a simple apache server and also read the default root with the index.html file...is there a...

Is it possble include Nesta CMS into Rails3 application ?

I'd like "to mount" a Nesta CMS app onto a Rails3 app This should be possible couse of being Nesta a Sinatra app, which should be a Rack mountable layer, ... but how would you do it ? Where will you start from ? Does anybody has experiences on this topic ? Suggested docs ? thanks in advance luca ...

Accessing Rack middleware objects

Hi, I'm using Faye for pubsub along with Sinatra. Presently, I'm using Faye:RackAdapter in my config.ru like so: use Faye::RackAdapter, :mount => '/faye', :timeout => 45 I'd like to be able to add extensions to the instance of Faye::Server. I've tried to retrieve the server object and manipulate it from Sinatra, but it doesn't appea...

It is possible for my Rails App knows under wich context of HTTP is running?

In certain situations I run my app in a context like: /context/app , but sometimes I only use: /app In my DB I have an applications table that has an attribute for the path of the application (ex. /app ), what Im looking is that my app could determine in wich context is running in order to update that attribute (ex. /context/app) I th...

Using Rack middleware for cross-domain sessions in same app

I have a white-labelled Rails app that allows me to create a variety of different new websites, each with their own TLD, but all powered by the same app. It's an ecommerce app so all orders are processed on a single, different TLD. For example, I might have three TLDs: domain_a.com domain_b.com domain_c.com and orders are processed o...

How to get objects of used Rack middleware running in a Rails app

I'm using Rack middleware that accepts some configuration that I need to change at run time. So I need the instance of its class that's currently in memory. Is there a way to do obtain it? ...

Rackup with HTTPS support

I've found this question, which doesn't really solve my problem but at least maybe lets me phrase my question the right way. I have a simple Camping app that I launch via rackup. I'd like to be able to test the app over a secure connection (self-signed server cert would be fine) but since I don't have root on my development box it'd be...

Rack rack.input variable getting truncated?

I wrote a piece of Rack Middleware to automatically unzip compressed request bodies. The code seems to be working just fine, but when I plug it into my rails app, I get a failure "Invalid JSON" from ActionController::ParamsParser. As a debugging mechanism, I'm writing both the zipped content, and the unzipped content to a file (to make...

nanoc site tested with unicorn

Hello, I have a nanoc site (so, all static pages) that I'd like to test with unicorn. The idea behind this is to host this site on heroku then. The structure is then a rack application. I have added a config.ru file like: require 'rubygems' require 'rack' require 'rack-rewrite' require 'rack/contrib' use Rack::Rewrite do rewrite '/','...

Rails 2.3.8 with thin doesn't work after installing rails 3.0.1

Hello, I have several Rails applications with version 2.3.8, which I run using the thin server. I want to install Rails 3.0.1 on the same machine for testing purposes. The installation worked fine, but after installing Rails 3.0.1, running Rails 2.3.8 applications with thin fails with this error: >> Using rails adapter Missing the Rai...

How can I use devise's "warden" to authenticate a rack app in the same stack as the rails app that uses devise ?

By the way, I'm using rails 3. How can I use devise's "warden" to authenticate a rack app in the same stack as the rails app that uses devise ? My problem is that when I call this: request.env['warden'] # nil :( from the other application on the rack stack I get nil ! I integrated dav4rack (webdav) in my rails app via config.ru. I ...

How can I get an ordered list of middleware in use in a generic rack application?

The functionality I am looking for is similar to the rake middleware command in Rails, except for a generic rack application. ...