Ruby on Rails: Server error with while trying to upload a file using attachment_fu: (can't convert nil into Integer) -
I followed a simple example to upload a file (see the link to the code below). When I upload the & lt;% = f.file_field: upload_data% & gt; Add, and submit buttons on the form (together or without file attachments), I get an error message in the web page: 500 Internal Server Error
I get an error message on the server log: TypeError (Zero can not be converted to integer):
I am Railroad 3.0.5, Ruby at 1.9.2, Windows 7
I used the sample code: http: //clarkware.com/blog/2007/02/24/file-upload-fu
Below you will get print out of the server log:
mugshot / new.html render within layout / app (10.0ms) Failed response during the ERB full 200 OK 28 9ms (scene: 49.0ms | ActiveRecord: 0.0ms) error: ActionView :: Template :: error c: /Ruby192/lib/ruby/gems/1.9.1/gems/ Activesupport-3.0.5 / lib / active_support / whiny_nil.rb: 48: `method_missing 'in c: / ruby192 / lib / ruby / gemstone / 1.9.1 / gemstone / action pack-3.0.5 / lib / action_ Dispatches / HT / Parameters RB: 10: In 'parameter': / RUB192 / LIB / RUB / GMGS / 1.9.1 /gems/actionpack-3.0.5/lib/action_d ispatch / middleware / templates / rescue / diagnostics.erb: 3: `_c___uby____ lib_ruby_gems_______gems_actionpack_______lib_action_dispatch_middleware_templates_rescues_diagnostics_erb___637362275_26463528_704965928 'in C: /Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.0.5/lib/action_view/template.rb: 135:' block in render 'c: / ruby192 / lib / Ruby / gems / 1.9.1 / gems / activesupport-3.0.5 / lib / active_support / notifications.rb: 54: c in 'instrument': / ruby 192 / lib / ruby / gems / 1.9.1 / gemstone / actionpack -3.0.5 / lib / action_view / template.rb: 127: `render 'c: /Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.0.5/web/action_view / render / render G.Rb: 59: Block in `_render_template 'c: /Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/ Notifications.rb: 52:' Block In Instrument ' C: /Ruby192/lib/ruby/gems/1.9.1/gems/activesupport-3.0.5/lib/active_support/notifications/instrumenter.rb: 21: `In instrument 'C: / Ruby192 / lib / ruby / gems / 1.9.1 / gems / activesupport-3.0.5 / lib / active_support / notifications.rb: 52: `In instrument T 'c: /Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.0.5/ Lib / action_view / render / rendering.rb: 56: `_render_template 'c: / ruby192 / lib / ruby / gemstone / 1.9.1 / gemstone / action pack-3.0.5 / lib / action_view / render / rendering RB: 26: `Render 'in C: / RUB 19/2 / Leib / RUB / Games / 1.9.1 / Games / ActivitiesPak-3.0.0 / lib / action_dispatch / middleware / show_exceptions.rb: 88:` Rescue_action_locky' C: /Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.0.5/lib/action_dispatch/middleware/show_exceptions RB: 68: `render_expression 'c: /Ruby192/lib/ruby/gems/1.9.1/gems/actionpack-3.0.5/lib/action_dispatch/middleware/show_exceptions.rb: 59: In' call ': c: / Ruby192 / Leib / Rabbi / Gemstones / 1.9.1 / Gemstones / Railways -0.0.5 / Leib / Rail / Rack / Logger RB: 13: In 'call': / Ruby192 / Lib / Ruby / Games / 1.9.1 /gems/rack-1.2.2/lib/rack/runtime.rb:17:in 'call' c: / Ruby192 / lib / ruby / gems / 1.9.1 / gems / activesupport-3.0.5 / lib / active_support / cache / strategy / local_ cache.rb: 72: `call 'c: /Ruby192/lib/ruby/gems/1.9. 1 / gems / rack-1.2.2 / lib / rack / lock.rb: 11: In 'Block Call' & lt; Internal: prelude & gt; 10: i 'synchronized' c: /Ruby192/lib/ruby/gems/1.9.1/gems/rack-1.2.2/lib/rack/lock.rb: 11: in 'call' c: / ruby192 / lib / Ruby / gemstone / 1.9.1 / gemstone / action pack-3.0.5 / lib / action_dispatch / middleware / static RB: 30: These `Calls 'C: / RUB 19 / LB / RUB / Games / 1.9.1 / Games / Release-3.0.0 / lib / rails / application.rb: 168:` In Call': / Ruby192 /lib/ruby/gems/1.9.1/gems/railties-3.0.5/lib/rails/application.rb: 77: `Method_missing 'c: /Ruby192/lib/ruby/gems/1.9.1/gems/railties -3.0.5 / lib / rails / rack / log_tailer.rb: 14: in 'call' c: / ruby192 / lib / rabbi / gemma / 1.9.1 / gem / rack-1.2.2 / leeb / rack / chanti_lambil RB: 13: In 'call': / Ruby 19/2 / Lib / Ruby / Games / 1.9.1 / Games / Crack-1.2.2 / lib / rack / handler / webrick.rb: 52: In 'service' : /Ruby192/lib/ruby/1.9.1/webrick/httpserver.rb: 111: In 'service': / ruby192 / lib /ruby/1.9.1/webrick/httpserver.rb:70:IN 'run' c: Start / "mugshots" for 127.0.0.1 /Ruby192/lib/ruby/1.9.1/webrick/server.rb: 183: Block in `start_thread ' 127.0.0.1 2011-03- Type error (can not be converted to zero in the integer):
Itemprop = "text">
This tutorial is very old and may be available for Rail 3.x Not irrelevant. I'm not sure that attachment_fu works with the current version of Rail.
I recommend
you can see other options
Comments
Post a Comment