尝试启动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类型,则只应注册该MIME类型。

关于ruby - Rails/Actionpack:警告:已经初始化的常量ICS,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/8873192/

10-12 22:42