我在运行时收到此错误
LoadError: Expected /home/user/Desktop/Tripurari/myapp/app/models/host.rb to define Host##
但它的每一件事的地方。有人可以告诉我方法下面的确切问题是什么。
def self.check_all(keyword)
memo_mutex = Mutex.new
memo = {}
threads = []
name = keyword.keyword
SITES.each do |site_and_options|
threads << Thread.new do
@host = Host.find_or_create_by_name(site)
if keyword.unavailable_usernames.find_by_host_id(@host.id)
memo[@host.name] = true
else
memo[@host.name] = false
end
end
end
threads.each { |t| t.join }
memo
end