Forum: Ruby on Rails NoMethodError

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.
42fdb86f725bd5891949c2d49b4db04a?d=identicon&s=25 Joey Boy (joeyboy)
on 2009-04-23 16:02
hi!

i was trying to run a rails based app, however i am stumped by the error
as shown below. i get this kind of error everywhere. for example if i
click on Company information, i would get this:

NoMethodError in Administration#company

Showing vendor/plugins/coupa_engine/app/views/layouts/coupa.rhtml where
line #6 raised:

undefined method `length' for #<Enumerable::Enumerator:0x7ff2c489d028>

Extracted source (around line #6):

3:
4:   This program is free software; you can redistribute it and/or
modify
5:   it under the terms of the GNU General Public License as published
by
6:   the Free Software Foundation; either version 2 of the License, or
7:   (at your option) any later version.
8:
9:   This program is distributed in the hope that it will be useful,

RAILS_ROOT: script/../config/..
Application Trace | Framework Trace | Full Trace

/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/text_helper.rb:36:in
`truncate'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:326:in
`send'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:326:in
`compile_and_render_template'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:301:in
`render_template'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:260:in
`render_file'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/layout.rb:254:in
`render_without_benchmark'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:50:in
`render'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:50:in
`render'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1096:in
`perform_action_without_filters'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:632:in
`call_filter'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in
`call_filter'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:438:in
`call'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in
`call_filter'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in
`call_filter'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:438:in
`call'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in
`call_filter'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in
`call_filter'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:449:in
`call'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in
`call_filter'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:619:in
`perform_action_without_benchmark'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/rescue.rb:83:in
`perform_action'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
`send'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
`process_without_filters'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in
`process_without_session_management_support'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in
`process_without_test'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/test_process.rb:15:in
`process'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in
`process'
/var/lib/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:79:in `service'
/var/lib/gems/1.8/gems/rails-1.2.3/lib/commands/servers/webrick.rb:59
/var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
`require'
/var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
`new_constants_in'
/var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
`require'
/var/lib/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39

#{RAILS_ROOT}/vendor/plugins/coupa_engine/app/views/layouts/coupa.rhtml:6:in
`_run_rhtml_47vendor47plugins47coupa_engine47app47views47layouts47coupa46rhtml'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/var/lib/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in `dispatch'
/var/lib/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:113:in
`handle_dispatch'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/var/lib/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:63:in
`dispatch'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
script/server:3

/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_view/helpers/text_helper.rb:36:in
`truncate'
#{RAILS_ROOT}/vendor/plugins/coupa_engine/app/views/layouts/coupa.rhtml:6:in
`_run_rhtml_47vendor47plugins47coupa_engine47app47views47layouts47coupa46rhtml'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:326:in
`send'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:326:in
`compile_and_render_template'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:301:in
`render_template'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_view/base.rb:260:in
`render_file'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/layout.rb:254:in
`render_without_benchmark'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:50:in
`render'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:50:in
`render'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:1096:in
`perform_action_without_filters'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:632:in
`call_filter'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in
`call_filter'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:438:in
`call'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in
`call_filter'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in
`call_filter'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:438:in
`call'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in
`call_filter'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:638:in
`call_filter'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:449:in
`call'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:637:in
`call_filter'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:619:in
`perform_action_without_benchmark'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
/usr/lib/ruby/1.8/benchmark.rb:293:in `measure'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/benchmarking.rb:66:in
`perform_action_without_rescue'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/rescue.rb:83:in
`perform_action'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
`send'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:430:in
`process_without_filters'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/filters.rb:624:in
`process_without_session_management_support'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/session_management.rb:114:in
`process_without_test'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/test_process.rb:15:in
`process'
/var/lib/gems/1.8/gems/actionpack-1.13.3/lib/action_controller/base.rb:330:in
`process'
/var/lib/gems/1.8/gems/rails-1.2.3/lib/dispatcher.rb:41:in `dispatch'
/var/lib/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:113:in
`handle_dispatch'
/var/lib/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:79:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service'
/usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run'
/usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread'
/usr/lib/ruby/1.8/webrick/server.rb:95:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `each'
/usr/lib/ruby/1.8/webrick/server.rb:92:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:23:in `start'
/usr/lib/ruby/1.8/webrick/server.rb:82:in `start'
/var/lib/gems/1.8/gems/rails-1.2.3/lib/webrick_server.rb:63:in
`dispatch'
/var/lib/gems/1.8/gems/rails-1.2.3/lib/commands/servers/webrick.rb:59
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
/var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
`require'
/var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in
`new_constants_in'
/var/lib/gems/1.8/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in
`require'
/var/lib/gems/1.8/gems/rails-1.2.3/lib/commands/server.rb:39
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in
`gem_original_require'
/usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
script/server:3

Request

Parameters: None

Show session dump

---
prev_uri: /administration/company
return-to:
:user: &id001 !ruby/object:User
  address_assignments:
  addresses:
  approval_limit:
  attributes:
    salt: 93c682538d8a6cb278197e2af0aa612a0c7cac9d
    default_account_id:
    created_at: 2009-04-19 03:43:01
    delete_after:
    updated_at: 2009-04-19 03:43:12.331075 +00:00
    deleted_at:
    role:
    security_token:
    manager_id:
    default_currency_id: "1"
    pcard_id:
    id: "29"
    lastname: e
    token_expiry:
    deleted: "0"
    phone_work: ""
    firstname: joey
    logged_in_at: 2009-04-19 03:43:12.323429 +00:00
    approval_limit_id:
    verified: "1"
    default_address_id:
    login: admin
    salted_password: 4ac2e1bd1e9ba29259a004a2b0143fb0984c10cf
    status: active
    email: joeye@gmail.com
    phone_mobile: ""
  children:
  default_account:
  default_address:
  default_currency:
  errors: !ruby/object:ActiveRecord::Errors
    base: *id001
    errors: {}

  new_password: false
  new_record_before_save:
  parent:
  pcard:
  roles:
  - !ruby/object:Role
    attributes:
      name: Admin
      role_id: "2"
      omnipotent: "1"
      id: "2"
      user_id: "29"
      system_role: "1"
      description: Full system access
  - !ruby/object:Role
    attributes:
      name: User
      role_id: "3"
      omnipotent: "0"
      id: "3"
      user_id: "29"
      system_role: "1"
      description: Default role for all logged-in users
  subscribed_ask_categories:
  subscriptions:
flash: !map:ActionController::Flash::FlashHash {}


Response
Headers: {"Status"=>"200 OK", "cookie"=>[], "Cache-Control"=>"no-cache"}



these are gems:

actionmailer (2.3.2, 1.3.3)
actionpack (2.3.2, 2.2.2, 1.13.3)
actionwebservice (1.2.3)
activerecord (2.3.2, 2.2.2, 1.15.3)
activesupport (2.3.2, 2.2.2, 1.4.2)
acts_as_ferret (0.4.1)
rails (1.2.3)
rake (0.8.4, 0.7.3)
rtf (0.1.0)
vpim (0.695)


any ideas on how get through the error?


thanks!

joey
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-04-23 16:07
(Received via mailing list)
On Apr 23, 3:02 pm, Joey Boy <rails-mailing-l...@andreas-s.net> wrote:

>
> any ideas on how get through the error?
>
it looks like you are running a rails 1.2.3 app against ruby 1.8.7
(which isn;t compatible with rails 1.2.3)

Fred
42fdb86f725bd5891949c2d49b4db04a?d=identicon&s=25 Joey Boy (joeyboy)
on 2009-04-23 16:53
Frederick Cheung wrote:
> On Apr 23, 3:02�pm, Joey Boy <rails-mailing-l...@andreas-s.net> wrote:
>
> it looks like you are running a rails 1.2.3 app against ruby 1.8.7
> (which isn;t compatible with rails 1.2.3)
>

hi!

thanks. that'll most likely be the reason. i know it's a problem on my
setup, not on the application.

so which ruby version can i use with rails 1.2.3? how do i downgrade?


thanks!

joey
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-04-23 18:05
(Received via mailing list)
On Apr 23, 3:53 pm, Joey Boy <rails-mailing-l...@andreas-s.net> wrote:
>
> so which ruby version can i use with rails 1.2.3? how do i downgrade?
>
1.8.6 is probably fine. how to install would depend on your platform.

Fred
42fdb86f725bd5891949c2d49b4db04a?d=identicon&s=25 Joey Boy (joeyboy)
on 2009-04-24 03:50
Frederick Cheung wrote:
> On Apr 23, 3:53�pm, Joey Boy <rails-mailing-l...@andreas-s.net> wrote:
>>
>> so which ruby version can i use with rails 1.2.3? how do i downgrade?
>>
> 1.8.6 is probably fine. how to install would depend on your platform.
>
> Fred

hi!

i'm on linux. how to downgrade?


thx.
42fdb86f725bd5891949c2d49b4db04a?d=identicon&s=25 Joey Boy (joeyboy)
on 2009-04-24 07:45
Joey Boy wrote:
> Frederick Cheung wrote:
>> On Apr 23, 3:53�pm, Joey Boy <rails-mailing-l...@andreas-s.net> wrote:
>>>
>>> so which ruby version can i use with rails 1.2.3? how do i downgrade?
>>>
>> 1.8.6 is probably fine. how to install would depend on your platform.
>>
>> Fred
>
> hi!
>
> i'm on linux. how to downgrade?
>
>
> thx.

it's ok. found it. thx for telling me its the version.

thx!
This topic is locked and can not be replied to.