Rails 3.2.8, heroku: uninitialized constant Less :: Engine

I see this error in the delayed work on the hero, and it makes no sense to me:

{uninitialized constant Less::Engine (in /app/app/assets/stylesheets/share_and_earn_recommendation_email.css.less) /app/vendor/bundle/ruby/1.9.1/gems/tilt-1.3.3/lib/tilt/css.rb:60:in `prepare' ... 

Why doesn’t it make sense? Since css.rb looks like this:

 def prepare if ::Less.const_defined? :Engine @engine = ::Less::Engine.new(data) # line 60 else ... 

This means that it is impossible to get to line 60 if Less::Engine is undefined. What am I missing?

EDIT

Even better demo from heroku console:

 irb(main):008:0> ::Less.const_defined? :Engine => true irb(main):009:0> ::Less::Engine NameError: uninitialized constant Less::Engine 

EDIT 2

This is becoming more interesting:

 irb(main):011:0> ::Less.const_defined? :Engine, false => false 

The difference is that the latter is not looking for ancestors. But there are no ancestors, so this should not matter:

 irb(main):012:0> ::Less.ancestors => [Less] 
+4
source share
1 answer

If you just upgraded the rails version on the 3.2.x stack, you will find that in earlier versions, such as 3.2.2, less is present than in later versions, such as 3.2.9.

I did not fully investigate the problem, but I noticed that when I went to upgrade from 3.2.2 to 3.2.9, I had a few "fewer" problems.

Greetings

+1
source

All Articles