igrigorik/async-rails — Issue #18: Rails 3.1 assets `stack level to deep`
Author: skyeagle
Created: 2011-11-24 17:42:44+00:00
State: open

Here is my solution for development environment to avoid `stack level to deep` for Rails 3.1.

Disable assets pipline in rails. Don't require sass-rails but instead require sass and sprockets in Gemfile.
Modified config.ru:

require ::File.expand_path('../config/environment', __FILE__)

Sass::Engine::DEFAULT_OPTIONS[:load_paths].tap do |load_paths|
load_paths << "app/assets/stylesheets"
load_paths << Compass::Frameworks['compass'].stylesheets_directory
load_paths << Compass::Frameworks['twitter_bootstrap'].stylesheets_directory
end

builder = Rack::Builder.new do
map '/assets' do
environment = Sprockets::Environment.new
environment.append_path 'app/assets/javascripts'
environment.append_path 'app/assets/stylesheets'
run environment
end

map '/' do
use Rack::FiberPool, :size => 250
run YourApp::Application
end
end
run builder