Topic: Problem with markdown_on_rails gem

I installed both the BlueCloth and markdown_on_rails gem.  I double checked and they both exist in:
/opt/local/lib/ruby/gems/1.8

Following the instructions on:
http://blog.rubygreenblue.com/project/markdown_on_rails

require 'markdown_on_rails'
ActionView::Base.register_template_handler('text', MarkdownOnRails)
MarkdownOnRails::map_headings_down_by 0

I get the error:
/opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:266:in `load_missing_constant': uninitialized constant ActionView (NameError)
        from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:452:in `const_missing'
        from /opt/local/lib/ruby/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:464:in `const_missing'
        from /Users/jerrycheung/Sites/home/config/environment.rb:14

Specifically, it dies on the second line "ActionView::Base.register_template_handler('text', MarkdownOnRails)".  The require works.

Has anyone ran into this problem?  I know of this error when a gem isn't properly installed, but the require does work.

Because it's what code craves.

Re: Problem with markdown_on_rails gem

It looks like you're running this code before Rails has loaded.  Did you put it at the bottom of your environment.rb?

Re: Problem with markdown_on_rails gem

That did it!  Thanks.

Because it's what code craves.

Re: Problem with markdown_on_rails gem

Hey, you're welcome :-)