Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8861575
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T15:31:18+00:00 2026-06-14T15:31:18+00:00

I have some Ruby code I need to execute in the Redmine Ruby app

  • 0

I have some Ruby code I need to execute in the Redmine Ruby app in order to enable a module in all projects at once.

Surprisingly, ruby does access the Projects, but raises a NoMethodError when accessing a few particular methods inside each of the “Project” objects.

Here is the code:

Project.find(:all).each do |project|

  print "Enabling modules for project '#{project.identifier}' ... "

  puts project.methods.sort            # this does print "enabled_module_names"
  puts project.enabled_module_names

end

This fails with:

hostname:/srv/apps/redmine# script/runner  vendor/plugins/customplugin/lib/enable_modules.rb
/var/lib/gems/1.8/gems/activerecord-2.3.5/lib/active_record/attribute_methods.rb:260:in `method_missing': undefined method `enabled_module_names' for #<Project:0x7f28985c1cb0> (NoMethodError)
    from vendor/plugins/customplugin/lib/enable_modules.rb:14
    from vendor/plugins/customplugin/lib/enable_modules.rb:7:in `each'
    from vendor/plugins/customplugin/lib/enable_modules.rb:7
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `eval'
    from /var/lib/gems/1.8/gems/rails-2.3.5/lib/commands/runner.rb:46
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from /usr/lib/ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from script/runner:3

I have scratched my head a lot, but I can’t grasp why would the code find the “Project” symbol but not the methods within, especially as “project.methods” does indeed list “enabled_module_names”.

Any help most welcome.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T15:31:19+00:00Added an answer on June 14, 2026 at 3:31 pm

    Are you sure that enable_module_names is an instance method?

    Is it within Project.instance_methods?

    Edit (summary of the comments below):

    In earlier versions, you have to use following:

    enabled_module_names = project.enabled_modules.collect(&:name)
    

    The getter is present in later versions only (see rev.4460 for details of this change)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have some ruby code like this: my_hash = { key1: value, key2: value
I am newbie in Ruby.. seeking some help.. I have a code DB =
In a Ruby on Rails app, we have some details which are stored as
I need a bit of help with some Ruby array jujitsu. I have the
I will like to know how can I execute some ruby code just before
I have some code that seems to execute improperly when it is serialized and
I have some ruby code like this: result1 = function_1(params) result2 = function_2(params) result3
I am new to ruby and need to debug some ruby app packaged as
I have some Ruby code that uses protected level attr_readers to be able to
I have never used ruby but need to translate this code to java. Can

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.