Questions tagged [nomethoderror]

A Ruby exception that is raised when a method is called on an object which doesn't respond to that method.

A NoMethodError exception is raised in Ruby when a method is called on an object that doesn't respond to that method and that doesn't have a method_missing hook to respond to it.

529 questions
-2
votes
1 answer

not letting me use .include? (trying to write ruby game)

I'm trying to write a text-based ruby game, and I can't figure out what's not allowing my code to use the .includes? method. These are the errors I'm getting: game.rb:31:in `home': undefined method `includes?' for "run":String (NoMethodError) …
Brice Lin
  • 424
  • 5
  • 11
-3
votes
1 answer

Why does mechanize raise NoMethodError on my page2.links.each method chain?

Error mySpiderScript.rb:119:in ` block (3 levels) in
': undefined method `links' for # (NoMethodError) Code agent2 = Mechanize.new page2 = agent2.get('http://www.mywebsite.net') page2.links.each do |link2| …
mamesaye
  • 1,705
  • 1
  • 28
  • 47
-3
votes
1 answer

How to make objects viewable for current user in rails

What I'm trying to do is make an index page that only shows the current user's posts, interests and albums instead of all interests and albums on the site. To do this I've tried using the current_user method in the PostsController but I keep getting…
nums
  • 61
  • 1
  • 8
-3
votes
1 answer

undefined method `+' for nil:NilClass in Ruby

I am using RubyMine to create a website. I have a calculation I’m doing in the model that is no longer working. It has worked previously, but now I’m receiving a NoMethodError stating that there is an undefined method `+' for nil:NilClass I have…
cwayne2
  • 93
  • 1
  • 7
1 2 3
35
36