尝试启动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
答案 0 :(得分:6)
它看起来像是" ICS" mime类型被声明两次。如果您可以找到一个被声明的实例,也许在config/initializers/mime_types.rb
中您可以像这样使用除非子句:
Mime::Type.register "text/calendar", :ics unless Mime::Type.lookup_by_extension(:ics)
如果mime类型不存在,则只应注册mime类型。