Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 249
GeekFitness Avatar asked Jul 21 '16 21:07

GeekFitness


4 Answers

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.

like image 176
joshaidan Avatar answered Nov 15 '22 21:11

joshaidan


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.

like image 43
Imran Ahmad Avatar answered Nov 15 '22 22:11

Imran Ahmad


sass-rails 5.0.6 fixed this for me!

bundle update sass-rails

like image 45
Rimian Avatar answered Nov 15 '22 20:11

Rimian


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

like image 36
David Avatar answered Nov 15 '22 22:11

David