nu7hatch/haml-magic-translations — Issue #1: Rails.root is nil when starting server
Author: spalladino
Created: 2011-11-24 15:25:02+00:00
State: open

I'm using the following versions of components:

rails (3.1.0)
haml (3.1.3)
haml-magic-translations (0.2.2)
haml-rails (0.3.4)

When starting the server with `rails s`, the following error is thrown (paths edited):

/gems/haml-3.1.3/lib/haml/util.rb:378:in `rails_root': ERROR: Rails.root is nil! (RuntimeError)
from /gems/haml-3.1.3/lib/haml/template.rb:76:in `'
from /gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from /gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /gems/haml-magic-translations-0.2.2/lib/haml/magic_translations.rb:2:in `'
from /gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `block in require'
from /gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `block in load_dependency'
from /gems/activesupport-3.1.0/lib/active_support/dependencies.rb:640:in `new_constants_in'
from /gems/activesupport-3.1.0/lib/active_support/dependencies.rb:223:in `load_dependency'
from /gems/activesupport-3.1.0/lib/active_support/dependencies.rb:240:in `require'
from /gems/haml-magic-translations-0.2.2/lib/haml-magic-translations.rb:1:in `'
from /gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `require'
from /gems/bundler-1.0.21/lib/bundler/runtime.rb:68:in `block (2 levels) in require'
from /gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `each'
from /gems/bundler-1.0.21/lib/bundler/runtime.rb:66:in `block in require'
from /gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `each'
from /gems/bundler-1.0.21/lib/bundler/runtime.rb:55:in `require'
from /gems/bundler-1.0.21/lib/bundler.rb:122:in `require'
from /myproject/config/application.rb:9:in `'
from /gems/railties-3.1.0/lib/rails/commands.rb:52:in `require'
from /gems/railties-3.1.0/lib/rails/commands.rb:52:in `block in '
from /gems/railties-3.1.0/lib/rails/commands.rb:49:in `tap'
from /gems/railties-3.1.0/lib/rails/commands.rb:49:in `'

The error seems to happen when `haml/template` is required by magic_translations. Any idea on how to fix?