Rails Server won't start, Deprecation Warning in Rails 5 (MIME? Sprockets?)
Asked Answered
T

5

10

I use 'rails s' and the server won't start. I just started it, too. And when I restarted it, I get this:

=> Booting Puma
=> Rails 5.0.0 application starting in development on http://localhost:3000
=> Run `rails server -h` for more startup options
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/bwkeeton/.rvm/gems/ruby-2.3.1@global/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/bwkeeton/.rvm/gems/ruby-2.3.1@global/gems/sass-rails-5.0.5/lib/sass/rails/railtie.rb:58)
Exiting

I can't figure out what is the problem. I updated my Gemfile to include Web Console 3.0 like one of the other questions mentioned, but it didn't help. I'm not sure how to fix the register engine and all that.

Tamratamsky answered 21/7, 2016 at 21:49 Comment(0)
K
2

i've had the same issue multiple times.

WARNING I am a newbie, and only have been programming ROR for a total of 7 weeks now, through a bootcamp called Wyncode.

My instructor Ed Toro has a gist on (Step 3) his github = @eddroid for finding what he likes to call "a lose puma".. which may be the reason for your server not running

Steps i took to get my server running again..

  1. Try exiting terminal (not sure your OS) but on MAC sometimes thats all you need

  2. check if you have a terminal window elsewhere, possibly running a server.. Because of the sprockets issue and its warnings.. its so far down sometimes you miss it.. if you do see that error. then Step 3 else Step 4:

  3. https://gist.github.com/eddroid or https://gist.github.com/eddroid/66980336dad2609341f28b8bbd632fa5.js

  4. restart and/or shut down your computer. it just fixed my issue.

Hope this helps

Kerato answered 23/7, 2016 at 20:6 Comment(0)
I
11

The deprecation warnings are related to this, and is caused by Sprockets 3.7.0. I guess things are changing in Sprockets 4 where it requires you to register a mime type before calling register_engine.

Anyway, the deprecation warnings should be fixed in shortly in sass-rails. But not sure why you're server isn't starting. I suspect it isn't related to this. Any more info you can give us?

UPDATE: The depreciation warning is now fixed in sass-rails version 5.0.6.

Irmgard answered 22/7, 2016 at 0:56 Comment(3)
I'm actually still getting the error on sass-rails 5.0.6 (OS X)Benefactor
There's a discussion about it on the github issue. It's possible that it could be another gem in your Gemfile that's not compatible with Sprockets 4 (or 3.7) that could be producing the deprecation warnings.Irmgard
@Irmgard is right. For me, upgrading less-rails helped. Please check out Gemfile.lock to see which gems have dependencies with Sprockets.Divide
C
8

I agree with @joshaidan's answer.

If you really don't want that warning, you can degrade the sprockets version to 3.6.3 All you have to do is: Add

gem 'sprockets', '3.6.3'

to you gem file. Now run

bundle update sprockets

Hope this will fix your problem for now.

Conservatoire answered 22/7, 2016 at 17:15 Comment(2)
I don't quite understand why, like but this worked. Like @Irmgard said, not sure why, but the server starts now. /boggleTamratamsky
The deprecation warnings are fixed in sass-rails 5.0.6. Sass-rails was what was calling Sprockets and causing the deprecation warning because a feature changed in it.Irmgard
P
5

sass-rails 5.0.6 fixed this for me!

bundle update sass-rails

Pigfish answered 25/7, 2016 at 3:19 Comment(0)
K
2

i've had the same issue multiple times.

WARNING I am a newbie, and only have been programming ROR for a total of 7 weeks now, through a bootcamp called Wyncode.

My instructor Ed Toro has a gist on (Step 3) his github = @eddroid for finding what he likes to call "a lose puma".. which may be the reason for your server not running

Steps i took to get my server running again..

  1. Try exiting terminal (not sure your OS) but on MAC sometimes thats all you need

  2. check if you have a terminal window elsewhere, possibly running a server.. Because of the sprockets issue and its warnings.. its so far down sometimes you miss it.. if you do see that error. then Step 3 else Step 4:

  3. https://gist.github.com/eddroid or https://gist.github.com/eddroid/66980336dad2609341f28b8bbd632fa5.js

  4. restart and/or shut down your computer. it just fixed my issue.

Hope this helps

Kerato answered 23/7, 2016 at 20:6 Comment(0)
A
2

Just upgrade to sass-rails 5.0.6.

You may need to edit your Gemfile if the version is locked.

bundle update sass-rails

This works with its dependencies:

 Using sprockets-rails 3.1.1
 Using sprockets 3.7.0
Appall answered 4/8, 2016 at 11:14 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.