Rails/Actionpack: warning: already initialized constant ICS

2k views Asked by At

trying to start Rails server and getting a "warning" I don't understand. Anyone know what it means? warning: already initialized constant ICS

Here it is in context:

meltemi$ rails s
=> Booting WEBrick
=> Rails 3.1.3 application starting in development on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
/Users/meltemi/.rvm/gems/ruby-1.9.3-p0@summit/gems/actionpack-3.1.3/lib/action_dispatch/http/mime_type.rb:101: warning: already initialized constant ICS
[2012-01-15 12:28:34] INFO  WEBrick 1.3.1
[2012-01-15 12:28:34] INFO  ruby 1.9.3 (2011-10-30) [x86_64-darwin11.2.0]
[2012-01-15 12:28:34] INFO  WEBrick::HTTPServer#start: pid=61345 port=3000
1

There are 1 answers

0
bamnet On BEST ANSWER

It looks like the "ICS" mime type is getting declared twice. If you can find once instance where it's being declared, maybe in config/initializers/mime_types.rb you can tack on an unless clause to it like this:

Mime::Type.register "text/calendar", :ics unless Mime::Type.lookup_by_extension(:ics)

This should only register the mime type if it doesn't already exist.