Assembla home | Assembla project page
 

Ticket #174 (closed defect: fixed)

Opened 3 years ago

Last modified 3 years ago

[PATCH] Fix for broken trac_tool.rb

Reported by: vamsee.breakout@gmail.com Assigned to: andy
Priority: normal Milestone:
Component: Core Severity: Open
Keywords: Cc:

Description

When I click on New Space, it breaks with the following error:

TypeError? in Spaces#new

can't convert Symbol into String

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

/usr/lib/ruby/1.8/drb/drb.rb:787:in `+' /usr/lib/ruby/1.8/drb/drb.rb:787:in `uri_option' /usr/lib/ruby/1.8/drb/drb.rb:785:in `uri_option' /usr/lib/ruby/1.8/drb/drb.rb:1041:in `initialize' #{RAILS_ROOT}/app/models/trac_tool.rb:9:in `set_defaults' #{RAILS_ROOT}app/controllers/spaces_controller.rb:186:in `new'

I changed the complaining symbol to string and it works now. No idea if it's the right fix, but working for now.

Attachments

trac_tool_symbol_fix.diff (441 bytes) - added by vamsee.breakout@gmail.com on 01/27/06 15:02:49.

Change History

01/27/06 15:02:49 changed by vamsee.breakout@gmail.com

  • attachment trac_tool_symbol_fix.diff added.

01/27/06 15:49:05 changed by andy

What is the error? Please send mee the error, and look at config/user_environment.rb to see if CONFIG[:trac_control_url] is set.

The symbol for should be correct. I am not going to apply this patch.

self.control = DRbObject.new(nil, UserSystem::CONFIG[:trac_control_url])

The variable CONFIG[:trac_control_url] is set in config/user_environment.rb . If you have an old version of user_environment.rb, then you will not have this variable. We should have some way of handling this error in trac_tool.rb so that it does not cause a problem for people who do not run the Trac tool in development.

We do not have any good way to update user_environment.rb for developers. It is not stored in Subversion. I think that we should have a new function to return configuration variables that looks for a default that is stored in environment.rb if the CONFIG[] variable form user_environment.rb is missing. Then we can add items without forcing everyone to update their configurations manually.

01/27/06 18:51:51 changed by vamsee.breakout@gmail.com

My config/environments/user_environment.rb does have the following lines:

    # URL for the control server DRb.
    :control_url => 'druby://localhost:8887',

    # URL for trac control center
    :trac_control_url => :control_url,

    # URL for subversion control center
    :trac_control_url => :control_url, 

However, in trac_tool.rb, if I change:

     self.control = DRbObject.new(nil, UserSystem::CONFIG[:trac_control_url]) 

to:

     self.control = DRbObject.new(nil, UserSystem::CONFIG[:control_url]) 

It works ok. Otherwise, the stack trace given at the top shows up. So, I would guess the assignment of :trac_control_url is not working. The stack trace is the same as the above given (in summary).

01/27/06 18:55:49 changed by anonymous

I should also note that I created my user_environment.rb by copying over the user_environment.rb.example given.

01/27/06 20:11:22 changed by andy

Well, this statement is clearly wrong:

      :trac_control_url => :control_url,

:control_url is a symbol, not a variable. So, the CONFIG[:trac_control_url] key is set to the symbol :control_url, not to the correct string string. I think you are the first person using this example file, so you found this bug. I checked in a change to fix this. However, the change is only to the user_environment.rb.example file. You can copy it to your user_environment.rb file. We need to figure out a way to propagate it to the developers that already have user_environment files.

01/27/06 20:42:16 changed by andy

  • status changed from new to closed.
  • resolution set to fixed.