'sass' in a non thread-safe way

主宰稳场 提交于 2019-12-02 19:11:06

have you tried doing this in Gemfile?

gem "sass", :require => 'sass'

this is an explicit call, without using initializers. by the way consider that you're using a rc1 release.

I had the same problem, and was able to solve it by compiling assets locally before pushing to Heroku as mentioned in the article Rails 3.1+ Asset Pipeline on Heroku Cedar

RAILS_ENV=production bundle exec rake assets:precompile

I also tried Itecedors suggestion which also worked:

While precompiling assets, in Rails 3.1.1 and up, you can prevent initializing
your application and connecting to the database by ensuring that the following 
line is in your > config/application.rb:

config.assets.initialize_on_precompile = false

On Heroku I was getting this same error and googling did not help me find the problem, so I thought I would add what I found to this questions since it comes up first when searching.

The problem was NOT this error, it was a smaller error while pushing the code up to Heroku. After the gems are listed these lines got me on the path to the answer:

Running: rake assets:precompile
rake aborted!
Tasks: TOP => environment
(See full trace by running task with --trace)
Precompiling assets failed, enabling runtime asset compilation
Injecting rails31_enable_runtime_asset_compilation
Please see this article for troubleshooting help:
http://devcenter.heroku.com/articles/rails31_heroku_cedar#troubleshooting

I had just been configuring Redis on Heroku so I knew that the problem had to be something related to those changes. At that URL I found this:

While precompiling assets, in Rails 3.1.1 and up, you can prevent initializing your application and connecting to the database by ensuring that the following line is in your > config/application.rb:

config.assets.initialize_on_precompile = false

Adding the on_precompile = false line fixed all the errors, including the original one in this question.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!