I know this is pretty exotic, but I want to deploy a Ruby web application (not Rails, but Rack based, so it plugs into most Ruby servers just fine) using JRuby. Google and friends give me a few success stories, but mostly rails related and if not, no details on the deployment are provided. The framework I'm using is Ramaze, if it matters...
We have a 42U rack which is getting a load of new 1U and 2U servers real soon. One of the guys here reckons that you need to leave a gap between the servers (of 1U) to aid cooling.
Question is, do you? When looking around the datacenter, no-one else seems to be, and it also diminishes how much we can fit in. We're using Dell 1850 and...
I want my server to send a multipart response (multipart/x-mixed-replace). I'd prefer some kind of solution using the Sinatra framework or a generic Rack app, but any example in ruby would be nice. Here's the equivalent of what I'm trying to do, in PHP:
<?php
header('Content-type: multipart/x-mixed-replace;boundary="rn9012"');
prin...
After I touch tmp/restart.txt and my app restarts, the first request throws an error, usually something about not finding Haml::Engine or some other gem. The second and subsequent requests all work fine. I was having this problem on Dreamhost which was running Rack 0.4.1 and Sinatra 0.3.3 but after moving to my own host and running a ne...
I don't get it!
Rack: http://rack.rubyforge.org/
Rails Metal: http://weblog.rubyonrails.org/2008/12/17/introducing-rails-metal
I read the two articles and my eyes got blurry. How do the two components relate? Examples would be great?
...
I'm trying to deploy a Sinatra app to Dreamhost and it says the following:
Since DH supports Passenger, which in
turn supports Rack-based ruby
applications, DH does indeed support
Sinatra.
I'm having difficulty parsing that statement - what's the difference between Rack and Passenger (and why is Sinatra "Rack-based")?
...
I have a Rack application that looks like this:
class Foo
def initialize(app)
@app = app
end
def call(env)
env["hello"] = "world"
@app.call(env)
end
end
After hooking my Rack application into Rails, how do I get access to env["hello"] from within Rails?
Update: Thanks to Gaius for the answer. Rack and Rails let y...
I'd like to have MyMiddleware run in my Rack app, but only for certain paths. I was hoping to use Rack::Builder or at least Rack::URLMap, but I can't quite figure out how.
This is what I thought would work, but doesn't:
# in my rackup file or Rails environment.rb:
map '/foo' do
use MyMiddleware, { :some => 'options' }
end
Or, bett...
Is there a way to map *.rb files to be executed under JRuby with the output being sent out to the browser like a CGI? Basically I'm looking for a JRuby CGI servlet.
Ideally, I'd like to define a JRuby servlet in web.xml and then be able to put *.rb files in WEB-INF/ruby and be able to call them via http://servername/contextname/rubypro...
I'm running a few rails/rake apps in Apache/passenger and I want to add the documentation app served by gem server to these apps, so I can easily give it a special (sub)domain, like docs.example.org, so it's easily available for all members of our team and nobody has to start the server himself or remember port numbers (like 8808, the de...
Does it make any difference in terms of developing Rails apps now that it uses rack to talk to web servers? Should we do anything differently to take advantage of it? Is it just cleaner or does it have any performance improvement over the cgi implementation?
...
I have a Cucumber step for my Rails application:
Then /^I should be redirected to the sign in page$/ do
assert_equal 302, @response.status
end
But that @response object is the one returned by my Controller, and it's the Rack middleware that sets the status to what I expect it to be. How can I get at the response as returned from th...
I am using Rails 2.3 and I decided to provide support for JSONP. Created a brand new application. Then ran script/generate scaffold User name:string
This is my entire environment.rb
RAILS_GEM_VERSION = '2.3.2' unless defined? RAILS_GEM_VERSION
require File.join(File.dirname(__FILE__), 'boot')
require 'rack/contrib'
Rails::Initializer.r...
So I deduced from Rack documentation, but maybe I am wrong...
...
I'm trying to make a web app in Sinatra, and I was wondering if there was a good solution for user sign-up with email verification, as well as authentication - perhaps as rack middleware? OpenID support would be nice to have too.
I suppose I can roll my own, but I didn't want to reinvent the wheel. If I have to do so, can anyone point m...
if I do this:
curl -X POST -H 'Content-type: application/xml' -d '<person>...</person>' 'http://0.0.0.0:3000/people/12?_method=PUT'
I get "Only get, put, and delete requests are allowed." Why? Rails 2.3.2
...
Does anyone have an example of how to add additional headers to the Thin Ruby server? Specifically, I need to add either "Accept-Ranges" or "X-Content-Duration" for media based files served, ogg audio and video mostly, served via the new HTML5 media elements.
If someone has a fix for this, or a link to a really good tutorial about Rack,...
When we try to start Nginx, we see this error that prevents Nginx from starting. The error exactly is:
"rack_env" directive is duplicate
We have set rails_env and rack_env... does this conflict in some way?
Any ideas what is meant by it? We can't find any meaningful documentation in the Nginx Passenger User guide nor in the source nor...
Hi,
I have a Ruby on Rails application I'm using Ruby 1.9 and Rails 2.3.4 and I want users to upload videos so I installed Paperclip gem but I'm getting this error from Rack. The fact that it says it's "invalid byte sequence" makes me suspect that it's from Ruby 1.9.
any ideas?
Thanks,
Tam
Rendering posts/new
Rendered posts/_form (...
Hey experts,
i run a rails app on passenger and it all works like it should.
Now i want to add an sinatra app to run as rack application with passenger, but i always get a routing error.
My VirtualHosts File looks like:
NameVirtualHost *:80
<VirtualHost *:80>
ServerName www.domain1.com
DocumentRoot /home/user1/vhosts/project1/pub...