I’m scraping a site with mechanize and pushing to a mysql db. I am getting these sys read errors a lot and I’m not sure what the solution is. I’m using the Ruby-mysql gem.
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I was doing the exact same thing (mechanize + mysql), and I solved it by wrapping my mysql calls with a begin/rescue/end clause:
Note that this puts your code in an infinite loop, if you use this in something real I would recommend putting some limiter on it. All the mysql_* are my own methods.