Rails/Actionpack:警告:已初始化常量ICS



试图启动Rails服务器,却收到一个我不理解的"警告"。有人知道这意味着什么吗?warning: already initialized constant ICS

这是在上下文中:

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

看起来"ICS"mime类型被声明了两次。如果你能找到一个声明它的实例,也许在config/initializers/mime_types.rb中,你可以在它上面加上一个除非子句,如下所示:

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

这应该只在mime类型不存在的情况下注册它。

相关内容

  • 没有找到相关文章

最新更新