On 26 ago, 22:34, Paul Barry <[EMAIL PROTECTED]> wrote: > Here's a little patch that adds rails/init.rb to the gemspec, so that > when you "rake install" haml, it puts that file in the gem, so that > Rails 2.1 apps don't have to generate the plugin with "haml --rails", > you just have to put config.gem "haml", :version => '>= 2.1.0' in > config/environment.rb. > > http://pastie.org/260479
Interesting. Does this actually work for you? I can't get this to work with Haml 2.0.2 and Rails 2.1.1. There does seem to be at least a couple of bugs in Rails' support of frozen gems: http://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/324 I found that Haml froze fine in Rails 2.1 but on updating to 2.1.1 it wouldn't work anymore without the patch attached to that ticket. Evidently Rails is choking on the -2.0.2 in the gem's folder name. But there seems to be another issue in that ticket, about the "init.rb" and "rails/init.rb" files not get evaluated in the right order, from the right place, or at all (the behaviour is inconsistent). I found that when I tried deploying to the remote server I was suddenly getting "uninitialized constant Rails::Initializer::Sass" errors. Turns out that the difference was that my local machine had 2.0.2 installed as a gem system-wide and the remote deployment machine only had 1.8.2. Once I remove the system-wide copies of the Haml gem I was able to reproduce the flaw on the local machine too. Further investigation showed that neither "init.rb" nor "rails/ init.rb" was getting evaluated in the frozen copy of the gem. Workaround was to move the gem back to vendor/plugins/haml again. I do have one other gem frozen into vendor/gems/ and that one works fine even though no other copy is installed system-wide, probably because that particular gem doesn't depend on anything being done in "init.rb" or "rails/init.rb". Would like to see this fixed, but not sure exactly where the fault lies. Looks to me like it might be a Rails bug if those files aren't getting evaluated. What do people think? Cheers, Wincent --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
