Guest User

Untitled

a guest
Sep 10th, 2018
149
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.12 KB | None | 0 0
  1. Ruby on Rails: No method error in Rails 3.0.10
  2. abstract (1.0.0)
  3. actionmailer (3.2.2, 3.0.10, 3.0.5, 3.0.3, 2.3.5, 2.1.0)
  4. actionpack (3.2.2, 3.0.10, 3.0.5, 3.0.3, 3.0.0.beta3, 2.3.5, 2.1.0)
  5. activemodel (3.2.2, 3.0.10, 3.0.5, 3.0.3, 3.0.0.beta3)
  6. activerecord (3.0.10)
  7. activeresource (3.2.2, 3.0.10, 3.0.5, 3.0.3, 2.3.5, 2.1.0)
  8. activesupport (3.2.2, 3.0.10, 3.0.5, 3.0.3, 3.0.0.beta3, 2.3.5, 2.1.0)
  9. arel (3.0.2, 2.0.10, 2.0.6)
  10. bcrypt-ruby (3.0.1, 2.1.2)
  11. bson (1.1.5)
  12. bson_ext (1.1.5)
  13. builder (3.0.0, 2.1.2)
  14. bundle (0.0.1)
  15. bundler (1.1.3, 1.1.1, 1.1.0)
  16. cancan (1.6.7, 1.4.1)
  17. coffee-rails (3.2.2)
  18. coffee-script (2.2.0)
  19. coffee-script-source (1.3.1, 1.2.0)
  20. devise (2.0.4, 1.5.3, 1.1.5)
  21. erubis (2.7.0, 2.6.6)
  22. execjs (1.3.0)
  23. hike (1.2.1)
  24. i18n (0.6.0, 0.5.0, 0.3.7)
  25. journey (1.0.3)
  26. jquery-rails (2.0.2, 2.0.1)
  27. jquery_datepicker (0.3.4)
  28. json (1.6.6, 1.6.5)
  29. libv8 (3.3.10.4 x86-linux)
  30. mail (2.4.4, 2.2.19, 2.2.12, 2.2.7)
  31. memcache-client (1.8.5)
  32. mime-types (1.18, 1.17.2, 1.16)
  33. mongo (1.1.5)
  34. mongoid (2.0.0.beta.20)
  35. multi_json (1.2.0)
  36. mysql2 (0.3.11)
  37. nifty-generators (0.4.2)
  38. orm_adapter (0.0.7)
  39. polyglot (0.3.3, 0.3.1)
  40. rack (1.4.1, 1.2.5, 1.2.1, 1.1.3, 1.0.1)
  41. rack-cache (1.2)
  42. rack-mount (0.6.14, 0.6.13)
  43. rack-ssl (1.3.2)
  44. rack-test (0.6.1, 0.5.7, 0.5.6)
  45. rails (3.0.10)
  46. railties (3.2.2, 3.0.10, 3.0.5, 3.0.3)
  47. rake (0.9.2.2, 0.8.7)
  48. rdoc (3.12)
  49. rolify (3.1.0)
  50. sass (3.1.15)
  51. sass-rails (3.2.5)
  52. sprockets (2.1.2)
  53. sqlite3 (1.3.5)
  54. therubyracer (0.9.10)
  55. thor (0.14.6)
  56. tilt (1.3.3)
  57. treetop (1.4.10, 1.4.9)
  58. tzinfo (0.3.33, 0.3.32, 0.3.23)
  59. uglifier (1.2.4)
  60. warden (1.1.1, 1.0.3)
  61. will_paginate (3.0.3, 3.0.pre2)
  62.  
  63. amrit@PC148881:~/mytodos$ rails console
  64. Loading development environment (Rails 3.0.10)
  65. 1.9.2-p290 :001 > todo=todo.first
  66. NoMethodError: You have a nil object when you didn't expect it!
  67. You might have expected an instance of Array.
  68. The error occurred while evaluating nil.first
  69. from (irb):1
  70. from /home/amrit/.rvm/gems/ruby-1.9.2-p290@1.9.2/gems/railties-3.0.10/lib/rails/commands/console.rb:44:in `start'
  71. from /home/amrit/.rvm/gems/ruby-1.9.2-p290@1.9.2/gems/railties-3.0.10/lib/rails/commands/console.rb:8:in `start'
  72. from /home/amrit/.rvm/gems/ruby-1.9.2-p290@1.9.2/gems/railties-3.0.10/lib/rails/commands.rb:23:in `<top (required)>'
  73. from script/rails:6:in `require'
  74. from script/rails:6:in `<main>'
  75. 1.9.2-p290 :002 > todo=Todo.first
  76. => #<Todo id: 1, name: "Office", description: "work to be completed at office", created_at: "2012-04-17 08:53:35", updated_at: "2012-04-17 08:53:35">
  77. 1.9.2-p290 :003 > task=Todo.tasks.new
  78. NoMethodError: undefined method `tasks' for #<Class:0xae32588>
  79. from /home/amrit/.rvm/gems/ruby-1.9.2-p290@1.9.2/gems/activerecord-3.0.10/lib/active_record/base.rb:1014:in `method_missing'
  80. from (irb):3
  81. from /home/amrit/.rvm/gems/ruby-1.9.2-p290@1.9.2/gems/railties-3.0.10/lib/rails/commands/console.rb:44:in `start'
  82. from /home/amrit/.rvm/gems/ruby-1.9.2-p290@1.9.2/gems/railties-3.0.10/lib/rails/commands/console.rb:8:in `start'
  83. from /home/amrit/.rvm/gems/ruby-1.9.2-p290@1.9.2/gems/railties-3.0.10/lib/rails/commands.rb:23:in `<top (required)>'
  84. from script/rails:6:in `require'
  85. from script/rails:6:in `<main>'
  86. 1.9.2-p290 :004 > ^C
  87. 1.9.2-p290 :004 > t=Task.new
  88. => #<Task id: nil, description: nil, due_date: nil, due_time: nil, completed: nil, todo_id: nil, created_at: nil, updated_at: nil>
  89. 1.9.2-p290 :005 > t.description="meeting"
  90. => "meeting"
  91. 1.9.2-p290 :006 > t.save
  92. => true
  93. 1.9.2-p290 :007 > task=Todo.tasks.new
  94. NoMethodError: undefined method `tasks' for #<Class:0xae32588>
  95. from /home/amrit/.rvm/gems/ruby-1.9.2-p290@1.9.2/gems/activerecord-3.0.10/lib/active_record/base.rb:1014:in `method_missing'
  96. from (irb):7
  97. from /home/amrit/.rvm/gems/ruby-1.9.2-p290@1.9.2/gems/railties-3.0.10/lib/rails/commands/console.rb:44:in `start'
  98. from /home/amrit/.rvm/gems/ruby-1.9.2-p290@1.9.2/gems/railties-3.0.10/lib/rails/commands/console.rb:8:in `start'
  99. from /home/amrit/.rvm/gems/ruby-1.9.2-p290@1.9.2/gems/railties-3.0.10/lib/rails/commands.rb:23:in `<top (required)>'
  100. from script/rails:6:in `require'
  101. from script/rails:6:in `<main>'
  102. 1.9.2-p290 :008 >
  103.  
  104. task=todo.tasks.new
  105.  
  106. todo=Todo.first
  107.  
  108. todo = Todo.all.first
Add Comment
Please, Sign In to add comment