haml / haml-rails

let your Gemfile do the talking
MIT License
1.04k stars 169 forks source link

rake test ==> "unitialized constant Haml" #62

Closed lsiden closed 10 years ago

lsiden commented 10 years ago

After installing Haml and haml-rails, when I try to run a test I get an "uninitialized constant Haml"

$ rake test
rake aborted!
uninitialized constant Haml
/home/lsiden/projects/myproject/rails/config/environment.rb:9:in `<top (required)>'

Did I miss something when I installed this gem or haml?

indirect commented 10 years ago

Uh... that doesn't happen for me, so I guess maybe you did?

lsiden commented 10 years ago

I fixed it by putting 'require Haml' in my environmnet.rb. It's only needed when running tests, not the server.

indirect commented 10 years ago

Sounds like the haml gem or haml-rails gem is probably not in a Bundler group that gets required when your tests run. Or you're trying to use the Haml constant before the Haml gem gets required. Not an issue with the haml-rails gem though.