用sublime text 2 编译Ruby 遇到编码的问题(UnicodeDecodeError: 'ascii' codec can't decode byte 0xc0 in position 9: ordinal not in range(128))

Ctrl+B编译遇到编码错误:UnicodeDecodeError: 'ascii' codec can't decode byte 0xb1 in position 258: ordinal not in range(128) 
 

路径为:C:Users您的用户名AppDataRoamingSublime Text 2PackagesDefaultexec.py,打开编辑

找到第44~45行中:

for k, v in proc_env.iteritems():

 proc_env[k] = os.path.expandvars(v).encode(sys.getfilesystemencoding())

两种修改方案:

1、果断注释掉!

2、对它进行异常处理,避免它出错时停止程序运行就像这样:

  
  for k, v in proc_env.iteritems():
            try:
                proc_env[k] = os.path.expandvars(v).encode(sys.getfilesystemencoding())
            except UnicodeDecodeError:
                print "Encoding error..."
                print "VARIABLE: ", k, " : ", v

原文地址:https://www.cnblogs.com/lee0201/p/sublimetext2_UnicodeDecodeError_ascii.html