redmine上傳檔案報錯問題解決

來源:互聯網
上載者:User

        一波剛平,一波又起。繼之前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 TypeFromNamerequire 'coderay/helpers/file_typeStarted GET "/projects/ssg-pmis-guide/issues/new" for 192.168.100.153 at Mon Jul 22 17:32:18 +0800 2013Processing 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 2013NoMethodError (undefined method `to_ary' for #<Mime::Type:0x2ae4a81f9228>):  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啦。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.