Fix Rakefile build task error handling