In the version of haml I'm using, it looks like the relevant code is
in vendor/plugins/haml/lib/haml/filters.rb. There is no filters
directory there.

In that file is:

      unless defined?(Markdown)
        # Uses RedCloth to provide only Markdown (not Textile) parsing
        class Markdown < RedCloth
          def render
            self.to_html(:markdown)
          end
        end
        puts 'Defined Markdown class'  # my debugging addition
      end

I also put a debugging line at the top of that file and confirmed it
prints when starting the server under both stock Ruby and REE.
However, that debugging line after the Markdown definition only prints
when I start the server using stock Ruby (and not REE).

I then added the line to the section above:

    unless NOT_LOADED.include? 'bluecloth'
      Markdown = BlueCloth unless defined?(Markdown)
      puts 'Testing'  # my debugging addition
    end

And the line prints on REE but not stock Ruby. So it looks like one is
using RedCloth and one is using BlueCloth?

Then I tried listing gems with both:

# gem list|egrep "(RedCloth|BlueCloth|haml)"
haml (3.0.18)
merb-haml (1.1.3)
RedCloth (4.2.3)

# /opt/ruby-enterprise-1.8.7-2010.02/bin/gem list|egrep "(RedCloth|
BlueCloth|haml)"
BlueCloth (1.0.1)
haml (3.0.18)
merb-haml (1.1.3)
RedCloth (4.2.3)

That's strange, so BlueCloth isn't on standard Ruby, even though I
thought it was. So, I did "gem install bluecloth" on standard Ruby,
only to find that bluecloth and BlueCloth are different gems (wow...).
Doing "gem install BlueCloth" now made both standard and REE show the
same gems.

So now, as predicted, both standard and enterprise Ruby fail with the
same error. So maybe I can just remove BlueCloth entirely and let it
use RedCloth to fix the problem (I'm not sure how those two libraries
are used)? But something still seems wrong. Why am I getting that
uninitialized constant error when BlueCloth is installed?

Thanks again for your help.


On Sep 9, 11:36 am, Nathan Weizenbaum <[email protected]> wrote:
> This is bizarre. Haml::Filters::Markdown should be defined in
> lib/haml/filters/markdown.rb... can you put a print in there to check if the
> file is loading?
>
> On Thu, Sep 9, 2010 at 11:27 AM, JR <[email protected]> wrote:
> > Hello,
>
> > I have posted this question in a couple different forums, but I'm
> > narrowing the problem down and thought I'd post here as well to see if
> > anyone can help me.
>
> > I'm deploying a Rails application to a new production server and am
> > running into a problem. When I start the server with "script/server
> > production" (which uses stock Ruby because of the "#!/usr/bin/env
> > ruby" at the top), I can navigate to the main page with no problems.
> > However, when I change the first line of script/server to "#!/opt/
> > ruby-
> > enterprise-.../bin/ruby" and start the server with "script/server
> > production", the server starts, but navigating to the main page in a
> > browser gives me this error:
>
> > ActionView::TemplateError (uninitialized constant
> > Haml::Filters::Markdown) in app/views/sessions/new.haml
>
> > I also get that error when starting Passenger, by the way, but I
> > started using "script/server production" to test.
>
> > When I do the same with "script/console production", regardless of
> > whether the hash-bang line points to standard Ruby or REE,
> > "Haml::Filters::Markdown" comes back with no problems.
>
> > Using REE's version of gem, I can see that the haml, RedCloth, and
> > BlueCloth gems are all installed. However, I believe haml is being
> > used as a plugin, and the relevant files are in vendor/plugins/haml.
>
> > So there's some clear difference between standard and enterprise Ruby
> > here, and I can't figure out what's wrong. The gem seems to be
> > installed under both, and the plugin is in a common directory so I
> > don't think that needs to be reinstalled with REE...
>
> > Any suggestions as to what is going on or what steps I can take to
> > troubleshoot?
>
> > Thanks in advance!
>
> > --
> > You received this message because you are subscribed to the Google Groups
> > "Haml" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to
> > [email protected] <haml%[email protected]>.
> > For more options, visit this group at
> >http://groups.google.com/group/haml?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to [email protected].
For more options, visit this group at http://groups.google.com/group/haml?hl=en.

Reply via email to