我正在尝试让facebook cleaner工作,但是它失败并显示以下消息:
./lib/facebook.rb:140:in `get_home': undefined method `email=' for nil:NilClass (NoMethodError)
from (eval):23:in `form_with'
from ./lib/facebook.rb:139:in `get_home'
from /var/lib/gems/1.8/gems/mechanize-2.5.1/lib/mechanize.rb:409:in `get'
from ./lib/facebook.rb:137:in `get_home'
from ./lib/facebook.rb:38:in `setup'
from fb_cleaner.rb:34
这是第136到145行的代码;
def get_home
@a.get(MOBILE_URL) do |page|
sleep(SLEEP_TIME)
@home = page.form_with(:action => "https://login.facebook.com/login.php?m=m") do |f|
f.email = @email
f.pass = @password
end.submit
end
@home
end # get_home
任何人都有线索?
答案 0 :(得分:1)