New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deprecation warnings with sprockets 3.7.0 #381

Closed
maia opened this Issue Jul 21, 2016 · 16 comments

Comments

Projects
None yet
9 participants
@maia

maia commented Jul 21, 2016

sass-rails-5.0.5 throws deprecation warnings when using sprockets 3.7.0:

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 /…/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 /…/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:58)
@rob-race

This comment has been minimized.

Show comment
Hide comment
@rob-race

rob-race Jul 21, 2016

Quick fix for me(for now) was...

gem 'sprockets', '3.6.3'

rob-race commented Jul 21, 2016

Quick fix for me(for now) was...

gem 'sprockets', '3.6.3'

@jaredbeck

This comment has been minimized.

Show comment
Hide comment
@jaredbeck

jaredbeck Jul 21, 2016

Same warning in js-routes (railsware/js-routes#201) I suspect a lot of sprockets extensions will be fixing this in similar ways and may benefit from each other's work.

jaredbeck commented Jul 21, 2016

Same warning in js-routes (railsware/js-routes#201) I suspect a lot of sprockets extensions will be fixing this in similar ways and may benefit from each other's work.

@kapso

This comment has been minimized.

Show comment
Hide comment
@kapso

kapso commented Jul 21, 2016

@rafaelfranca

This comment has been minimized.

Show comment
Hide comment
@rafaelfranca
Member

rafaelfranca commented Jul 21, 2016

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Jul 21, 2016

Member

Working on a PR.

Member

schneems commented Jul 21, 2016

Working on a PR.

schneems added a commit that referenced this issue Jul 21, 2016

schneems added a commit that referenced this issue Jul 21, 2016

[close #381] Avoid Sprockets deprecations
- Use both `register_engine` and `register_transformer` in railtie.rb. 
- In the test postprocessor use an object that responds to `call` and `new.render`.

schneems added a commit that referenced this issue Jul 22, 2016

[close #381] Avoid Sprockets deprecations
- Use both `register_engine` and `register_transformer` in railtie.rb. 
- In the test postprocessor use an object that responds to `call` and `new.render`.

schneems added a commit that referenced this issue Jul 22, 2016

[close #381] Avoid Sprockets deprecations
- Use both `register_engine` and `register_transformer` in railtie.rb. 
- In the test postprocessor use an object that responds to `call` and `new.render`.

schneems added a commit that referenced this issue Jul 22, 2016

@maia

This comment has been minimized.

Show comment
Hide comment
@maia

maia Jul 23, 2016

@schneems Thanks a lot for solving the issue with the release of 5.0.6!

maia commented Jul 23, 2016

@schneems Thanks a lot for solving the issue with the release of 5.0.6!

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Jul 23, 2016

Member

Thanks all for chiming in. I added some docs to Sprockets guides on master to show how to register an processor across Sprockets 2, 3, and 4. Link: https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#registering-all-versions-of-sprockets-in-processors

I also re-wrote the guide to be easier to reference, put the most relevant examples at the top of the sections and added a table of contents at the top. Please take a look and if you have something to add or ways you think the docs could be better open an issue and we can talk about it. I want the process of maintaining Sprockets extensions to be as easy as possible, I'm hoping the docs can smooth out rough edges and cut down on guessing how to write a sprockets plugin.

If you're working on getting rid of deprecations in your own library and having problems, ping me on a pull request.

Member

schneems commented Jul 23, 2016

Thanks all for chiming in. I added some docs to Sprockets guides on master to show how to register an processor across Sprockets 2, 3, and 4. Link: https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#registering-all-versions-of-sprockets-in-processors

I also re-wrote the guide to be easier to reference, put the most relevant examples at the top of the sections and added a table of contents at the top. Please take a look and if you have something to add or ways you think the docs could be better open an issue and we can talk about it. I want the process of maintaining Sprockets extensions to be as easy as possible, I'm hoping the docs can smooth out rough edges and cut down on guessing how to write a sprockets plugin.

If you're working on getting rid of deprecations in your own library and having problems, ping me on a pull request.

@calderJamNet

This comment has been minimized.

Show comment
Hide comment
@calderJamNet

calderJamNet Jul 31, 2016

hey @schneems , I just updated my gem library for the first time in a while and a bunch of css/scss (but not everything) is not loading correctly, and I'm also seeing this error. Is it likely that this is related? I've never really used sprockets before so its not really clear to me why this would be happening.

calderJamNet commented Jul 31, 2016

hey @schneems , I just updated my gem library for the first time in a while and a bunch of css/scss (but not everything) is not loading correctly, and I'm also seeing this error. Is it likely that this is related? I've never really used sprockets before so its not really clear to me why this would be happening.

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Aug 1, 2016

Member

@calderJamNet if you have a repro example app please put it on github and give me access. If not you can manually specify an older version of sprockets and sass-rails in your Gemfile.lock.

Do you have any more details other than not working correctly?

Member

schneems commented Aug 1, 2016

@calderJamNet if you have a repro example app please put it on github and give me access. If not you can manually specify an older version of sprockets and sass-rails in your Gemfile.lock.

Do you have any more details other than not working correctly?

@calderJamNet

This comment has been minimized.

Show comment
Hide comment
@calderJamNet

calderJamNet Aug 3, 2016

Hey @schneems, I added you to the repo. Its just a testing ground for front end styles so its kind of a mess. I did however notice the same changes when I updated all the gems in the main repo.

The differences I have noticed so far have only affected "border" and "color" css styles, with the original foundation styles being applied now while before they were being overwritten. They are minor and could be fixed easily with "!important" but I would like to understand why this started happening if possible.

This is how it was before bundle update:
screen shot 2016-08-02 at 10 49 38 pm

This is how it is after:
screen shot 2016-08-02 at 10 49 27 pm

so far I've only noticed it affecting styles for founations ".accordion", so perhaps the issue is routed in something they changed, in which case I apologize for wasting your time.

calderJamNet commented Aug 3, 2016

Hey @schneems, I added you to the repo. Its just a testing ground for front end styles so its kind of a mess. I did however notice the same changes when I updated all the gems in the main repo.

The differences I have noticed so far have only affected "border" and "color" css styles, with the original foundation styles being applied now while before they were being overwritten. They are minor and could be fixed easily with "!important" but I would like to understand why this started happening if possible.

This is how it was before bundle update:
screen shot 2016-08-02 at 10 49 38 pm

This is how it is after:
screen shot 2016-08-02 at 10 49 27 pm

so far I've only noticed it affecting styles for founations ".accordion", so perhaps the issue is routed in something they changed, in which case I apologize for wasting your time.

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Aug 15, 2016

Member

@calderJamNet i'm back from vacation and will probably have time to look at this sometime this week. I made an issue for a reminder since this issue is "closed" #384

Member

schneems commented Aug 15, 2016

@calderJamNet i'm back from vacation and will probably have time to look at this sometime this week. I made an issue for a reminder since this issue is "closed" #384

@veborich

This comment has been minimized.

Show comment
Hide comment
@veborich

veborich Aug 16, 2016

Thanks all for chiming in. I added some docs to Sprockets guides on master to show how to register an processor across Sprockets 2, 3, and 4. Link: https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#registering-all-versions-of-sprockets-in-processors

@schneems I haven't customized Sprockets before -- what's the typical file/location that you would place the env conditional code you provide in that link above?

veborich commented Aug 16, 2016

Thanks all for chiming in. I added some docs to Sprockets guides on master to show how to register an processor across Sprockets 2, 3, and 4. Link: https://github.com/rails/sprockets/blob/master/guides/extending_sprockets.md#registering-all-versions-of-sprockets-in-processors

@schneems I haven't customized Sprockets before -- what's the typical file/location that you would place the env conditional code you provide in that link above?

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Aug 16, 2016

Member

I haven't customized Sprockets before

This deprecation should only come from gems that are customizing sprockets for you, what is the deprecation output say? It should point it at a location, probably from a gem.

Member

schneems commented Aug 16, 2016

I haven't customized Sprockets before

This deprecation should only come from gems that are customizing sprockets for you, what is the deprecation output say? It should point it at a location, probably from a gem.

@calderJamNet

This comment has been minimized.

Show comment
Hide comment
@calderJamNet

calderJamNet Aug 17, 2016

@schneems I haven't customized sprockets before this either. How do I view the deprecation output?

calderJamNet commented Aug 17, 2016

@schneems I haven't customized sprockets before this either. How do I view the deprecation output?

@schneems

This comment has been minimized.

Show comment
Hide comment
@schneems

schneems Aug 17, 2016

Member

@calderJamNet i don't understand the question. If you're using Sprockets 3.7 and using another gem that doesn't support Sprockets 4 yet, then you'll see deprecation output in your output when you build assets or run in development.

Member

schneems commented Aug 17, 2016

@calderJamNet i don't understand the question. If you're using Sprockets 3.7 and using another gem that doesn't support Sprockets 4 yet, then you'll see deprecation output in your output when you build assets or run in development.

@scarekr0w

This comment has been minimized.

Show comment
Hide comment
@scarekr0w

scarekr0w Aug 26, 2016

  1. Add the sass rails gem to the the GemFile
    a) gem 'sass-rails', '~> 5.0', '>= 5.0.6'

  2. Run gem install sass-rails on the terminal
    a) gem install sass-rails

  3. Run bundle install
    a) bundle install --without production && bundle update

scarekr0w commented Aug 26, 2016

  1. Add the sass rails gem to the the GemFile
    a) gem 'sass-rails', '~> 5.0', '>= 5.0.6'

  2. Run gem install sass-rails on the terminal
    a) gem install sass-rails

  3. Run bundle install
    a) bundle install --without production && bundle update

kikito added a commit to consul/consul that referenced this issue Aug 30, 2016

ispyropoulos added a commit to testributor/katana that referenced this issue Sep 7, 2016

dgmstuart added a commit to dgmstuart/swingoutlondon2 that referenced this issue Sep 9, 2016

(chore): Upgrade to Rails 5
sass-rails had an issue, so needed to be greater than 5.0.6
rails/sass-rails#381

dsteelma-umd added a commit to dsteelma-umd/archelon that referenced this issue Aug 16, 2017

LIBHYDRA-105 Updated "sass-rails" gem to remove deprecation warnings
Update "sass-rails" gem from v5.0.5 to v5.0.6 to fix the following
deprecation warnings appearing at startup and running tests:

```
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 /Users/dsteelma/.rvm/gems/ruby-2.2.4@archelon/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 /Users/dsteelma/.rvm/gems/ruby-2.2.4@archelon/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:58)
```

See rails/sass-rails#381

https://issues.umd.edu/browse/LIBHYDRA-105

dsteelma-umd added a commit to dsteelma-umd/archelon that referenced this issue Aug 16, 2017

LIBHYDRA-105 Updated "sass-rails" gem to remove deprecation warnings
Update "sass-rails" gem from v5.0.5 to v5.0.6 to fix the following
deprecation warnings appearing at startup and running tests:

```
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 /Users/dsteelma/.rvm/gems/ruby-2.2.4@archelon/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 /Users/dsteelma/.rvm/gems/ruby-2.2.4@archelon/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:58)
```

See rails/sass-rails#381

https://issues.umd.edu/browse/LIBHYDRA-105

dsteelma-umd added a commit to dsteelma-umd/archelon that referenced this issue Aug 16, 2017

LIBHYDRA-105 Updated "sass-rails" gem to remove deprecation warnings
Update "sass-rails" gem from v5.0.5 to v5.0.6 to fix the following
deprecation warnings appearing at startup and running tests:

```
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 /Users/dsteelma/.rvm/gems/ruby-2.2.4@archelon/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 /Users/dsteelma/.rvm/gems/ruby-2.2.4@archelon/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:58)
```

See rails/sass-rails#381

https://issues.umd.edu/browse/LIBHYDRA-105

havenwood pushed a commit to havenwood/connect-api-examples that referenced this issue Dec 7, 2017

Shannon Skipper
Bump the sass-rails gem version
The Rails update from 4.2.6 to 4.2.7 caused Sprockets-related
deprecation warnings:

  DEPRECATION WARNING: Sprockets method `register_engine` is deprecated.

These were fixed in sass-rails: rails/sass-rails#381

raysapida added a commit to raysapida/mustached-octo-robot that referenced this issue Aug 11, 2018

Update ruby verion to 2.3.0 and rails to 4.2.8
- Had to update gems individually as bundle update informed me of
dependencies that they could not match.
- The gem sass-rails was throwing a deprecation for a sprocket method
called `register_enginerj` and had to be updated. Reference:
rails/sass-rails#381
- Specs were throwing an error `undefined method `cache' for nil:NilClass`
and researching solved it by updating rspec-rails
- Kept changing gem versions until I found that all specs were passing
again
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment