utf-8必须置顶,如果放在其他位置,会导致后面如果遇到中文无法解析,然后报其他乱七八糟的错误,比如不能连接数据库,比如语法错误。。。。。。这种错误不好找,切记!!!
出错代码:
#!/bin/env ruby $: << '/var/lib/gems/1.9.1/gems/librrd-1.0.4/ext/librrd' # encoding: utf-8
修改为:
# encoding: utf-8 #!/bin/env ruby $: << '/var/lib/gems/1.9.1/gems/librrd-1.0.4/ext/librrd'