JR
2010-Sep-07 21:22 UTC
Deploying a Rails app: Uninitialized constant Haml::Filters::Markdown
Hello all, I already posted this question on stackoverflow.com, but I figured there would be more people that could help me here, so I''m posting to this list as well. I am in the process of deploying a Rails application (that works fine in development) to a new production server running Apache and Passenger (with Ruby Enterprise Edition). When I navigate to the main page, I get the following in my production.log (along with a 500 Internal Server Error from Apache): ActionView::TemplateError (uninitialized constant Haml::Filters::Markdown) in app/views/sessions/new.haml I have the haml and RedCloth gems installed: *** LOCAL GEMS *** [...] haml (3.0.18) RedCloth (4.2.3) That constant is defined when I refer to it in a Rails console: # script/console production Loading production environment.>> Haml::Filters::Markdown=> Haml::Filters::Markdown The problem doesn''t occur in development, and the gems installed and codebase are the same as far as I can tell. Any idea what is causing this? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Sep-08 06:57 UTC
Re: Deploying a Rails app: Uninitialized constant Haml::Filters::Markdown
On Sep 7, 10:22 pm, JR <matkus...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Hello all, > > I already posted this question on stackoverflow.com, but I figured > there would be more people that could help me here, so I''m posting to > this list as well. > > I am in the process of deploying a Rails application (that works fine > in development) to a new production server running Apache and > Passenger (with Ruby Enterprise Edition). When I navigate to the main > page, I get the following in my production.log (along with a 500 > Internal Server Error from Apache): > > ActionView::TemplateError (uninitialized constant > Haml::Filters::Markdown) in app/views/sessions/new.haml > > I have the haml and RedCloth gems installed: > > *** LOCAL GEMS *** > [...] > haml (3.0.18) > RedCloth (4.2.3) > > That constant is defined when I refer to it in a Rails console: > > # script/console production > Loading production environment.>> Haml::Filters::Markdown > > => Haml::Filters::Markdown > > The problem doesn''t occur in development, and the gems installed and > codebase are the same as far as I can tell. Any idea what is causing > this?How are you loading the haml gem? If you are loading it at the bottom of environment.rb (outside the Rails::Initializer.run block ) then the gem is loaded after rails preloads your application code. This preload only happens in production mode, which is why it doesn''t matter in development Fred -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
JR
2010-Sep-08 16:12 UTC
Re: Deploying a Rails app: Uninitialized constant Haml::Filters::Markdown
Thanks for the info. I poked around, and see that haml is installed as a plugin, not a gem (all the files are in vendor/plugins/haml). It sounds like all you should have to do then is name files *.haml and it should work (http://stackoverflow.com/questions/99211/how-do-i-get- haml-to-work-with-rails). I should also mention that it not only works in development, but in production mode on another server. I''m actually moving an existing application from one server to another by setting up the environment, moving the codebase over, and deploying it. As far as I know everything is the same on the new server (gems installed, code, etc.), so I don''t know why it''s not working and am at a loss as to where to start troubleshooting. Any help is appreciated. Thanks! On Sep 7, 11:57 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> On Sep 7, 10:22 pm, JR <matkus...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hello all, > > > I already posted this question on stackoverflow.com, but I figured > > there would be more people that could help me here, so I''m posting to > > this list as well. > > > I am in the process of deploying a Rails application (that works fine > > in development) to a new production server running Apache and > > Passenger (with Ruby Enterprise Edition). When I navigate to the main > > page, I get the following in my production.log (along with a 500 > > Internal Server Error from Apache): > > > ActionView::TemplateError (uninitialized constant > > Haml::Filters::Markdown) in app/views/sessions/new.haml > > > I have the haml and RedCloth gems installed: > > > *** LOCAL GEMS *** > > [...] > > haml (3.0.18) > > RedCloth (4.2.3) > > > That constant is defined when I refer to it in a Rails console: > > > # script/console production > > Loading production environment.>> Haml::Filters::Markdown > > > => Haml::Filters::Markdown > > > The problem doesn''t occur in development, and the gems installed and > > codebase are the same as far as I can tell. Any idea what is causing > > this? > > How are you loading the haml gem? If you are loading it at the bottom > of environment.rb (outside the Rails::Initializer.run block ) then the > gem is loaded after rails preloads your application code. This preload > only happens in production mode, which is why it doesn''t matter in > development > > Fred-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
JR
2010-Sep-08 20:51 UTC
Re: Deploying a Rails app: Uninitialized constant Haml::Filters::Markdown
After some more investigation, I realized the application/page load just fine when I start them with "script/server production". So the issue has something to do with the way Passenger is setting up the environment, I guess. On Sep 8, 9:12 am, JR <matkus...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> Thanks for the info. I poked around, and see that haml is installed as > a plugin, not a gem (all the files are in vendor/plugins/haml). It > sounds like all you should have to do then is name files *.haml and it > should work (http://stackoverflow.com/questions/99211/how-do-i-get- > haml-to-work-with-rails). > > I should also mention that it not only works in development, but in > production mode on another server. I''m actually moving an existing > application from one server to another by setting up the environment, > moving the codebase over, and deploying it. As far as I know > everything is the same on the new server (gems installed, code, etc.), > so I don''t know why it''s not working and am at a loss as to where to > start troubleshooting. > > Any help is appreciated. Thanks! > > On Sep 7, 11:57 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > wrote: > > > On Sep 7, 10:22 pm, JR <matkus...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hello all, > > > > I already posted this question on stackoverflow.com, but I figured > > > there would be more people that could help me here, so I''m posting to > > > this list as well. > > > > I am in the process of deploying a Rails application (that works fine > > > in development) to a new production server running Apache and > > > Passenger (with Ruby Enterprise Edition). When I navigate to the main > > > page, I get the following in my production.log (along with a 500 > > > Internal Server Error from Apache): > > > > ActionView::TemplateError (uninitialized constant > > > Haml::Filters::Markdown) in app/views/sessions/new.haml > > > > I have the haml and RedCloth gems installed: > > > > *** LOCAL GEMS *** > > > [...] > > > haml (3.0.18) > > > RedCloth (4.2.3) > > > > That constant is defined when I refer to it in a Rails console: > > > > # script/console production > > > Loading production environment.>> Haml::Filters::Markdown > > > > => Haml::Filters::Markdown > > > > The problem doesn''t occur in development, and the gems installed and > > > codebase are the same as far as I can tell. Any idea what is causing > > > this? > > > How are you loading the haml gem? If you are loading it at the bottom > > of environment.rb (outside the Rails::Initializer.run block ) then the > > gem is loaded after rails preloads your application code. This preload > > only happens in production mode, which is why it doesn''t matter in > > development > > > Fred-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
JR
2010-Sep-16 22:07 UTC
Re: Deploying a Rails app: Uninitialized constant Haml::Filters::Markdown
Just in case someone comes searching for this, I narrowed down the problem to the BlueCloth gem. Removing the gem removes this problem, installing it again causes it again. That''s as far as I was able to get... On Sep 8, 1:51 pm, JR <matkus...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> After some more investigation, I realized the application/page load > just fine when I start them with "script/server production". So the > issue has something to do with the way Passenger is setting up the > environment, I guess. > > On Sep 8, 9:12 am, JR <matkus...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > Thanks for the info. I poked around, and see that haml is installed as > > a plugin, not a gem (all the files are in vendor/plugins/haml). It > > sounds like all you should have to do then is name files *.haml and it > > should work (http://stackoverflow.com/questions/99211/how-do-i-get- > > haml-to-work-with-rails). > > > I should also mention that it not only works in development, but in > > production mode on another server. I''m actually moving an existing > > application from one server to another by setting up the environment, > > moving the codebase over, and deploying it. As far as I know > > everything is the same on the new server (gems installed, code, etc.), > > so I don''t know why it''s not working and am at a loss as to where to > > start troubleshooting. > > > Any help is appreciated. Thanks! > > > On Sep 7, 11:57 pm, Frederick Cheung <frederick.che...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> > > wrote: > > > > On Sep 7, 10:22 pm, JR <matkus...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > > Hello all, > > > > > I already posted this question on stackoverflow.com, but I figured > > > > there would be more people that could help me here, so I''m posting to > > > > this list as well. > > > > > I am in the process of deploying a Rails application (that works fine > > > > in development) to a new production server running Apache and > > > > Passenger (with Ruby Enterprise Edition). When I navigate to the main > > > > page, I get the following in my production.log (along with a 500 > > > > Internal Server Error from Apache): > > > > > ActionView::TemplateError (uninitialized constant > > > > Haml::Filters::Markdown) in app/views/sessions/new.haml > > > > > I have the haml and RedCloth gems installed: > > > > > *** LOCAL GEMS *** > > > > [...] > > > > haml (3.0.18) > > > > RedCloth (4.2.3) > > > > > That constant is defined when I refer to it in a Rails console: > > > > > # script/console production > > > > Loading production environment.>> Haml::Filters::Markdown > > > > > => Haml::Filters::Markdown > > > > > The problem doesn''t occur in development, and the gems installed and > > > > codebase are the same as far as I can tell. Any idea what is causing > > > > this? > > > > How are you loading the haml gem? If you are loading it at the bottom > > > of environment.rb (outside the Rails::Initializer.run block ) then the > > > gem is loaded after rails preloads your application code. This preload > > > only happens in production mode, which is why it doesn''t matter in > > > development > > > > Fred-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.