redmine上传文件报错问题解决

        一波刚平,一波又起。继之前redmine出现各种问题之后,这次出问题又找上了我。

       这次是无法上传文件及附件,界面上可以看到的报错信息是Internal Server Error。光凭这点信息无法找到解决方案。

       更进一步查找LOG,报错信息如下:

Apache/2.2.3 (CentOS) configured -- resuming normal operations
/usr/local/lib/ruby/gems/1.8/gems/coderay-1.0.9/lib/coderay/helpers/file_type.rb:19: warning: already 

initialized constant UnknownFileType
/usr/local/lib/ruby/gems/1.8/gems/coderay-1.0.9/lib/coderay/helpers/file_type.rb:126: warning: already 

initialized constant TypeFromExt
/usr/local/lib/ruby/gems/1.8/gems/coderay-1.0.9/lib/coderay/helpers/file_type.rb:132: warning: already 

initialized constant TypeFromShebang
/usr/local/lib/ruby/gems/1.8/gems/coderay-1.0.9/lib/coderay/helpers/file_type.rb:138: warning: already 

initialized constant TypeFromName



require 'coderay/helpers/file_type


Started GET "/projects/ssg-pmis-guide/issues/new" for 192.168.100.153 at Mon Jul 22 17:32:18 +0800 2013
Processing by IssuesController#new as HTML
  Parameters: {"project_id"=>"ssg-pmis-guide"}
  Current user: admin (id=1)
  Rendered issues/_form_custom_fields.html.erb (17.9ms)
  Rendered issues/_attributes.html.erb (135.8ms)
  Rendered issues/_form.html.erb (149.1ms)
  Rendered attachments/_form.html.erb (2.1ms)
  Rendered issues/new.html.erb within layouts/base (155.5ms)
Completed 200 OK in 200ms (Views: 167.0ms | ActiveRecord: 12.1ms)
Started POST "/uploads.js?attachment_id=1&filename=my.txt" for 192.168.100.153 at Mon Jul 22 17:32:33 +0800 

2013

NoMethodError (undefined method `to_ary' for #):
  actionpack (3.2.13) lib/action_dispatch/http/mime_type.rb:270:in `method_missing'
  actionpack (3.2.13) lib/action_dispatch/http/mime_negotiation.rb:55:in `Array'
  actionpack (3.2.13) lib/action_dispatch/http/mime_negotiation.rb:55:in `formats'
  actionpack (3.2.13) lib/action_dispatch/http/mime_negotiation.rb:49:in `format'
  actionpack (3.2.13) lib/action_controller/metal/instrumentation.rb:22:in `process_action'
  actionpack (3.2.13) lib/action_controller/metal/params_wrapper.rb:207:in `process_action'
  activerecord (3.2.13) lib/active_record/railties/controller_runtime.rb:18:in `process_action'
  actionpack (3.2.13) lib/abstract_controller/base.rb:121:in `process'
  actionpack (3.2.13) lib/abstract_controller/rendering.rb:45:in `process'
  actionpack (3.2.13) lib/action_controller/metal.rb:203:in `dispatch'
  actionpack (3.2.13) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch'
  actionpack (3.2.13) lib/action_controller/metal.rb:246:in `action'
  actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `call'
  actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:73:in `dispatch'
  actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:36:in `call'
  journey (1.0.4) lib/journey/router.rb:68:in `call'
  journey (1.0.4) lib/journey/router.rb:56:in `each'
  journey (1.0.4) lib/journey/router.rb:56:in `call'
  actionpack (3.2.13) lib/action_dispatch/routing/route_set.rb:612:in `call'
  rack-openid (1.3.1) lib/rack/openid.rb:98:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call'
  rack (1.4.5) lib/rack/etag.rb:23:in `call'
  rack (1.4.5) lib/rack/conditionalget.rb:35:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/head.rb:14:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/params_parser.rb:21:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/flash.rb:242:in `call'
  rack (1.4.5) lib/rack/session/abstract/id.rb:210:in `context'
  rack (1.4.5) lib/rack/session/abstract/id.rb:205:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/cookies.rb:341:in `call'
  activerecord (3.2.13) lib/active_record/query_cache.rb:64:in `call'
  activerecord (3.2.13) lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:28:in `call'
  activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `_run__397314981__call__4__callbacks'
  activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `send'
  activesupport (3.2.13) lib/active_support/callbacks.rb:405:in `__run_callback'
  activesupport (3.2.13) lib/active_support/callbacks.rb:385:in `_run_call_callbacks'
  activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `send'
  activesupport (3.2.13) lib/active_support/callbacks.rb:81:in `run_callbacks'
  actionpack (3.2.13) lib/action_dispatch/middleware/callbacks.rb:27:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/remote_ip.rb:31:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:16:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call'
  railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app'
  railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
  activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged'
  railties (3.2.13) lib/rails/rack/logger.rb:16:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call'
  rack (1.4.5) lib/rack/methodoverride.rb:21:in `call'
  rack (1.4.5) lib/rack/runtime.rb:17:in `call'
  activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call'
  rack (1.4.5) lib/rack/lock.rb:15:in `call'
  actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call'
  rack-cache (1.2) lib/rack/cache/context.rb:136:in `forward'
  rack-cache (1.2) lib/rack/cache/context.rb:143:in `pass'
  rack-cache (1.2) lib/rack/cache/context.rb:155:in `invalidate'
  rack-cache (1.2) lib/rack/cache/context.rb:71:in `call!'
  rack-cache (1.2) lib/rack/cache/context.rb:51:in `call'
  railties (3.2.13) lib/rails/engine.rb:479:in `call'
  railties (3.2.13) lib/rails/application.rb:223:in `call'
  rack (1.4.5) lib/rack/content_length.rb:14:in `call'
  railties (3.2.13) lib/rails/rack/log_tailer.rb:17:in `call'
  rack (1.4.5) lib/rack/handler/webrick.rb:59:in `service'
  /usr/local/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
  /usr/local/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
  /usr/local/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
  /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start'
  /usr/local/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
  /usr/local/lib/ruby/1.8/webrick/server.rb:95:in `start'
  /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `each'
  /usr/local/lib/ruby/1.8/webrick/server.rb:92:in `start'
  /usr/local/lib/ruby/1.8/webrick/server.rb:23:in `start'
  /usr/local/lib/ruby/1.8/webrick/server.rb:82:in `start'
  rack (1.4.5) lib/rack/handler/webrick.rb:13:in `run'
  rack (1.4.5) lib/rack/server.rb:268:in `start'
  railties (3.2.13) lib/rails/commands/server.rb:70:in `start'
  railties (3.2.13) lib/rails/commands.rb:55
  railties (3.2.13) lib/rails/commands.rb:50:in `tap'
  railties (3.2.13) lib/rails/commands.rb:50
  script/rails:6:in `require'
  script/rails:6

           通过各种度娘谷哥,查到解决方案如下。

         

          修改如下文件

     actionpack (3.2.6) lib/action_dispatch/http/mime_negotiation.rb

         将这句改为
     Array(Mime[parameters[:format]])

          这个
      Array.wrap(Mime[parameters[:format]])
          一切OK啦。

你可能感兴趣的:(Linux,其它)