Forum: Ruby on Rails High Priority Problem , when uploading image

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
25c4b7d5fc7f09900d8f272bcb31d114?d=identicon&s=25 Hamid Raza (hamidraza)
on 2009-03-10 15:55
i m uploading an image and found following error , plz n e buddi help me
out ,
thxxxxxx in advace ,
my rails version is 2.2.2
and ruby version is 1.8.7
and i m using attachment_fu + mini_magick

the error is



Processing AdvertController#picture (for 127.0.0.1 at 2009-03-10
18:12:04) [POST]
  Session ID: 16244113122f7096dbfc3daf1b4cb25a
  Parameters: {"commit"=>"upload image", "action"=>"picture",
"count"=>"1", "controller"=>"advert",
"picture"=>{"uploaded_data"=>#<StringIO:0xb69ce814>}}


NoMethodError (undefined method `[]' for
#<Enumerable::Enumerator:0xb677ce08>):
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/core_ext/string/access.rb:43:in
`first'
    /home/hamid/rails/arabibay/vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb:70:in
`has_attachment'
    /home/hamid/rails/arabibay/app/models/picture.rb:6
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:203:in
`load_without_new_constant_marking'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:203:in
`load_file'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in
`new_constants_in'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:202:in
`load_file'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:94:in
`require_or_load'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:248:in
`load_missing_constant'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:452:in
`const_missing'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:464:in
`const_missing'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:470:in
`send'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:470:in
`const_missing'
    /home/hamid/rails/arabibay/app/controllers/advert_controller.rb:201:in
`picture'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/base.rb:1101:in
`send'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/base.rb:1101:in
`perform_action_without_filters'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/filters.rb:696:in
`call_filters'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/filters.rb:688:in
`perform_action_without_benchmark'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
    /usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/rescue.rb:83:in
`perform_action'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/base.rb:435:in
`send'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/base.rb:435:in
`process_without_filters'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/filters.rb:684:in
`process_without_session_management_support'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/session_management.rb:114:in
`process'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.13.6/lib/action_controller/base.rb:334:in
`process'
    /usr/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/dispatcher.rb:41:in
`dispatch'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:76:in
`process'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in
`synchronize'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/../lib/mongrel/rails.rb:74:in
`process'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in
`process_client'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
`each'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
`process_client'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`run'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`initialize'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`new'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`run'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
`initialize'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
`new'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
`run'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:282:in
`run'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in
`each'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/configurator.rb:281:in
`run'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:128:in
`run'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel/command.rb:212:in
`run'
    /usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/bin/mongrel_rails:281
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:488:in
`load'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:488:in
`load'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in
`new_constants_in'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:488:in
`load'
    /usr/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/commands/servers/mongrel.rb:60
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in
`require'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:342:in
`new_constants_in'
    /usr/lib/ruby/gems/1.8/gems/activesupport-1.4.4/lib/active_support/dependencies.rb:495:in
`require'
    /usr/lib/ruby/gems/1.8/gems/rails-1.2.6/lib/commands/server.rb:39
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`gem_original_require'
    /usr/local/lib/site_ruby/1.8/rubygems/custom_require.rb:31:in
`require'
    script/server:3
5f94b9b346c2aa648a80bc259978e5bc?d=identicon&s=25 Colin Law (Guest)
on 2009-03-10 17:27
(Received via mailing list)
The trace suggests an problem in advert_controller.rb line 201. Have you
had
a look there?

2009/3/10 Hamid Raza <rails-mailing-list@andreas-s.net>
4c438a80fc30661ad619ea177cf9cbd0?d=identicon&s=25 Freddy Andersen (Guest)
on 2009-03-10 17:57
(Received via mailing list)
Could we get a look at the picture model? looks like it has issues at
line 6
25c4b7d5fc7f09900d8f272bcb31d114?d=identicon&s=25 Hamid Raza (hamidraza)
on 2009-03-11 10:28
Freddy Andersen wrote:
> Could we get a look at the picture model? looks like it has issues at
> line 6

dear fellow , the problem is not with model or controller , as the code
i have of application is running fine on another system , :s , i think
its a problem with plugin :(
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-03-11 11:10
(Received via mailing list)
On Mar 11, 9:28 am, Hamid Raza <rails-mailing-l...@andreas-s.net>
wrote:
> Freddy Andersen wrote:
> > Could we get a look at the picture model? looks like it has issues at
> > line 6
>
> dear fellow , the problem is not with model or controller , as the code
> i have of application is running fine on another system , :s , i think
> its a problem with plugin :(

Well the plugin code is also the same on both systems. You claim to be
running rails 2.2.2 yet the stack trace clearly shows you are running
rails 1.2.6, which isn't compatible with ruby 1.8.7.

Fred
This topic is locked and can not be replied to.