lucasmazza/ruby-stylus — Issue #14: Rails 3.1.3 error
Author: TycoooN
Created: 2011-12-30 19:14:31+00:00
State: open

Hi, I'm trying to test the Stylus language in a clean rails app and I get the "ActionView::Template::Error (You have a nil object when you didn't expect it!" error every time I request the css that should be generated by Stylus.

My Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.1.3'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'coffee-rails'
gem 'uglifier'
gem 'stylus'
end

gem 'jquery-rails'

The error trace:

execjs (1.2.13) lib/execjs/external_runtime.rb:146:in `exec_runtime'
execjs (1.2.13) lib/execjs/external_runtime.rb:27:in `block in exec'
execjs (1.2.13) lib/execjs/external_runtime.rb:40:in `compile_to_tempfile'
execjs (1.2.13) lib/execjs/external_runtime.rb:26:in `exec'
execjs (1.2.13) lib/execjs/external_runtime.rb:18:in `eval'
execjs (1.2.13) lib/execjs/external_runtime.rb:32:in `call'
stylus (0.4.0) lib/stylus.rb:106:in `compile'
stylus (0.4.0) lib/stylus/tilt.rb:25:in `evaluate'
tilt (1.3.3) lib/tilt/template.rb:76:in `render'
sprockets (2.0.3) lib/sprockets/context.rb:175:in `block in evaluate'
sprockets (2.0.3) lib/sprockets/context.rb:172:in `each'
sprockets (2.0.3) lib/sprockets/context.rb:172:in `evaluate'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:171:in `build_dependency_context_and_body'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:135:in `dependency_context'
sprockets (2.0.3) lib/sprockets/bundled_asset.rb:194:in `build_dependencies_paths_and_assets'

This happens even when I directly request `assets/test.css` from by browser (with `app/assets/test.css.styl` is empty or has some simple rule)