解决办法:文件开头加上 # encoding: utf-8 参考链接:http://stackoverflow.com/questions/3678172/ruby-1-9-invalid-multibyte-char-us-ascii