forgot password?


   
 
NoMethodError in Todos#index
Posted: 22 September 2008 06:05 PM   [ Ignore ]  
Newbie
Rank
Total Posts:  5
Joined  2008-05-03

Hello,

I was running Tracks 1.5 happily when I made the stupid mistake of updating my Debian installation to its latest release. Then I got Ruby 1.8.7 (package ruby1.8, version 1.8.7.22-3) and I could not log in anymore due to errors. So I decided to update my Tracks to 1.6 and now I can loging, but then I got the messages on the web page that I include below (but no logs). Curiously for me, a longer version gets copied using Windows copy/paste, which I have attached.

Any help would be greatly appreciated.

Regards,

Rafael

NoMethodError in Todos#index

Showing todos/_toggle_notes.rhtml where line #3 raised:

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

Extracted source (around line #3):

1: <%= link_to(image_tag( 'blank.png', :width=>'16', :height=>'16', :border=>'0' ), "#", {:class => 'show_notes', :title => 'Show notes'}) %>
2: <% apply_behavior 'a.show_notes:click', :prevent_default => true do |page, element|
3:      element.next('.todo_notes').toggle
4:    end
5: -%>
6:       <div class="todo_notes" id="<%= dom_id(item, 'notes') %>" style="display:none">

Trace of template inclusion: /todos/_todo.html.erb, /contexts/_context.rhtml, /todos/index.html.erb

RAILS_ROOT: /opt/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:1079:in 
`method_missing'
vendor/plugins/unobtrusive_javascript/lib/ujs/javascript_proxies.rb:43:in `__send__'
vendor/plugins/unobtrusive_javascript/lib/ujs/javascript_proxies.rb:43:in `method_missing'
app/views/todos/_toggle_notes.rhtml:3:in 
`_run_erb_47app47views47todos47_toggle_notes46rhtml'
app/views/todos/_toggle_notes.rhtml:2:in `_run_erb_47app47views47todos47_toggle_notes46rhtml'
app/views/todos/_todo.html.erb:19:in `_run_erb_47app47views47todos47_todo46html46erb'
app/views/contexts/_context.rhtml:34:in 
`_run_erb_47app47views47contexts47_context46rhtml'
app/views/todos/index.html.erb:4:in `_run_erb_47app47views47todos47index46html46erb'
app/controllers/todos_controller.rb:568:in `render_todos_html'
app/controllers/todos_controller.rb:18:in 
`index'

Request

Parameters:

None

Show session dump

--- 
:js_behaviours: 
  :rules: []

  :options: 
    :reapply_after_ajax: true
    :cache: 
return-to: 
user_id: 2
flash: !map:ActionController::Flash::FlashHash 
  :notice: "Login successful: session will not expire."
noexpiry: "on"

Response

Headers:

{"Content-Type"=>"text/html",
 "cookie"=>[],
 "Cache-Control"=>"no-cache"} 
Profile
 
 
Posted: 23 September 2008 07:49 AM   [ Ignore ]   [ # 1 ]  
Newbie
Rank
Total Posts:  2
Joined  2008-09-23

I am having the same problem. I’m running Debian Lenny which has Ruby 1.8.7.72, using Tracks 1.6. After a new install I go to 0.0.0..:3000 and enter the account details I want. Then I get this after I hit submit:

NoMethodError in Todos#index

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

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

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: /var/www/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'
vendor/rails/actionpack/lib/action_view/helpers/prototype_helper.rb:1219:in `method_missing'
app/views/layouts/standard.html.erb:40:in `_run_erb_47app47views47layouts47standard46html46erb'
app/views/layouts/standard.html.erb:39:in 
`_run_erb_47app47views47layouts47standard46html46erb'
app/controllers/todos_controller.rb:568:in `render_todos_html'
app/controllers/todos_controller.rb:18:in `index'

Request

Parameters:

None

Show session dump

--- 
:js_behaviours: 
  :rules: []

  :options: 
    :reapply_after_ajax: true
    :cache: 
expiry_time: 2008-09-23 10:41:26.442511 +02:00
user_id: 1
return-to: 
flash: !map:ActionController::Flash::FlashHash {}


Response

Headers:

{"Status"=>"200 OK",
 "Content-Type"=>"text/html",
 "cookie"=>[],
 "Cache-Control"=>"no-cache"} 

PS: It’s very annoying that this forum doesn’t allow posts that are long enough to copy/paste the error page (which has the full trace included).

Profile
 
 
Posted: 23 September 2008 01:10 PM   [ Ignore ]   [ # 2 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

I’ve only seen this report for debian systems with a recent ruby. I’m not sure what the problem is, but I think the latest tracks from the git repo has a fix, probably because of the rails upgrade.

Profile
 
 
Posted: 30 September 2008 02:53 PM   [ Ignore ]   [ # 3 ]  
Newbie
Rank
Total Posts:  5
Joined  2008-05-03

Nope. I get the error message:

Application error
Rails application failed to start properly

Would it be possible to install Tracks using the local rails (as installed in Debian) instead of the one located in the vendor directory? Do you reckon that may help to solve the problem?

Profile
 
 
Posted: 30 September 2008 05:35 PM   [ Ignore ]   [ # 4 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

I’m not sure it will work.
Tracks is now on rails2.0.2 while the latest rails is 2.1. I’ve tried the upgrade, but some plugins we use do not work with rails2.1.

Profile
 
 
Posted: 01 October 2008 08:32 PM   [ Ignore ]   [ # 5 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

BTW, the application error you mention in your last reply, is that the same error about _toggle_notes.rhtml ?

Profile
 
 
Posted: 03 October 2008 09:28 PM   [ Ignore ]   [ # 6 ]  
Newbie
Rank
Total Posts:  5
Joined  2008-05-03

I don’t know. It displays what I wrote and nothing more appears anywhere, not even the log file.

Profile
 
 
Posted: 04 October 2008 11:44 AM   [ Ignore ]   [ # 7 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

It could be that the error was not saved in the log file. Perhaps something went wrong starting Tracks.

You could try to start Tracks from the command line and see if there are any errors there.

Profile
 
 
Posted: 04 October 2008 03:52 PM   [ Ignore ]   [ # 8 ]  
Newbie
Rank
Total Posts:  5
Joined  2008-05-03

I did not know I could do that. How?  (I am using Apache2 but I guess I can try the internal server if necessary)

Profile
 
 
Posted: 04 October 2008 05:57 PM   [ Ignore ]   [ # 9 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

from your tracks directory use

ruby script/server

to start your server on port 3000

you can access it through http://localhost:3000/

Profile
 
 
Posted: 04 November 2008 01:30 AM   [ Ignore ]   [ # 10 ]  
Newbie
Rank
Total Posts:  5
Joined  2008-05-03

Well, it works! So it seems the problem is a compatibility problem with Apache+New Ruby.

Profile
 
 
Posted: 04 November 2008 09:22 PM   [ Ignore ]   [ # 11 ]  
Newbie
Rank
Total Posts:  1
Joined  2008-11-04

I also get this message having upgraded from Ubuntu Hardy to Intrepid.

I downgraded the Rails version to 2.0.2 but still no success.

I always start the mongrel server from the command line and then start Tracks from my browser but no luck -any suggestions gratefully received.

Profile
 
 
Posted: 05 November 2008 08:05 AM   [ Ignore ]   [ # 12 ]  
Sr. Member
RankRankRankRank
Total Posts:  882
Joined  2006-10-05

Tracks comes with its own copy of rails, so downgrading rails in ubuntu won’t work because tracks (or any ruby on rails app) will first use the rails version that is bundled.

I’d suggest you either try to downgrade ruby rather than rails or you can consider using the current dev version in stead of 1.6.

Not the best suggestions, I know, we need to converge to a 1.7 release…

Profile
 
 
Posted: 25 November 2008 03:35 PM   [ Ignore ]   [ # 13 ]  
Newbie
Rank
Total Posts:  3
Joined  2008-11-25

At least for Debian users there is a solution in: http://www.mail-archive.com/debian-bugs-dist@lists.debian.org/msg528878.html

Go to the config/initializers/ directory and create a file (for instance code.rb) with the following:

unless '1.9'.respond_to?(:force_encoding)
  
String.class_eval do
    
begin
      remove_method 
:chars
    rescue NameError
      
# OK
    
end
  end
end 
Profile
 
 
Posted: 27 November 2008 03:36 AM   [ Ignore ]   [ # 14 ]  
Newbie
Rank
Total Posts:  1
Joined  2008-11-27

Same error CentOS - however the above entry corrected it.

Profile
 
 
   
 
 
‹‹ Daemonising?      Tracks production errors. ››