简体   繁体   中英

rails 4 - rake command shows deprecation warning everytime I run the rake db:migrate command

[pinterestclone]$ rake db:migrate  

DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.  
Please register a mime type using `register_mime_type` then  
use `register_compressor` or `register_transformer`.  
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors  
 (called from block (2 levels) in <class:Railtie> at  /usr/local/lib/ruby/gems/2.3.0/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:57)  

DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.
Please register a mime type using `register_mime_type` then
use `register_compressor` or `register_transformer`.
https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#supporting-all-versions-of-sprockets-in-processors
 (called from block (2 levels) in <class:Railtie> at /usr/local/lib/ruby/gems/2.3.0/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:58)

== 20160721232702 AddUserIdToPins: migrating ==================================  
-- add_column(:pins, :user_id, :integer)  
   -> 0.0010s  
-- add_index(:pins, :user_id)  
   -> 0.0010s  
== 20160721232702 AddUserIdToPins: migrated (0.0022s) =========================

This is caused by Sprockets 3.7.0 and should be fixed in sass-rails (which uses Sprockets) shortly. See this for more information.

I guess Sprockets 4 requires you to register a mime type before calling register_engine.

UPDATE : This is now fixed in sass-rails version 5.0.6. Running bundle update should remove the deprecation warnings.

要解决此问题,请在终端中打开您的项目并编写“bundle update sprockets”

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM