Hi,

> After upgrading from ruby1.8_1.8.6.114-2 to ruby1.8_1.8.7-2, I noticed a rails
> webapp called "Tracks" v1.6, stopped working.
> 
> The error is as mentioned in the subject line. Steps to reproduce:
> - download http://www.rousette.org.uk/projects/files/tracks-current.zip
> - unzip, and configure (you can simply use the blank sqlite3 database 
> provided)
> - start the WEBrick server
> - see any page except the login/signup page fail
> - downgrade to 1.8.6.114-2
> - everything works again

I got the following error:
------------------------------------------------------------------------------
NoMethodError in Todos#index

Showing layouts/standard.html.erb where line #40 raised:

undefined method `[]' for #<Enumerable::Enumerator:0xb6e4c968>

Extracted source (around line #40):

37: </div>
38: <div id="minilinks">
39:   <%= link_to_function("Toggle notes", nil, {:accesskey => "S", :title => 
"Toggle all notes", :id => "toggle-notes-nav"}) do |page|
40:               page.select('body .todo_notes').each { |e| e.toggle }
41:             end
42:     -%>&nbsp;|&nbsp;
43:     <%= link_to "Logout (#{current_user.display_name}) ยป", logout_path %>

RAILS_ROOT: /tmp/tracks-1.6

Application Trace | Framework Trace | Full Trace

vendor/rails/activesupport/lib/active_support/core_ext/string/access.rb:43:in 
`first'
vendor/rails/activesupport/lib/active_support/inflector.rb:151:in `camelize'
vendor/rails/activesupport/lib/active_support/core_ext/string/inflections.rb:49:in
 `camelize'
vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:1237:in 
`enumerate'
[...]
------------------------------------------------------------------------------

Ruby 1.8.7 has String#chars.
It returns an Enumerator object
but Rails 2.0.2 expects an ActiveSupport::Multibyte::Chars object.

You can avoid this conflict by putting
the following code in config/initializers/ directory.

------------------------------------------------------------------------------
unless '1.9'.respond_to?(:force_encoding)
  String.class_eval do
    begin
      remove_method :chars
    rescue NameError
      # OK
    end
  end
end
------------------------------------------------------------------------------

Note: activesupport/lib/active_support/core_ext/string/unicode.rb
of Rails 2.1.0 removes "chars" method from String class of Ruby 1.8.7.

-- 
ay



--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to