# Load the rails application
# encoding: utf-8
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Review::Application.initialize!
WillPaginate::ViewHelpers.pagination_options[:previous_label] = '«上一页'
WillPaginate::ViewHelpers.pagination_options[:next_label] = '下一页»'
# encoding: utf-8
require File.expand_path('../application', __FILE__)
# Initialize the rails application
Review::Application.initialize!
WillPaginate::ViewHelpers.pagination_options[:previous_label] = '«上一页'
WillPaginate::ViewHelpers.pagination_options[:next_label] = '下一页»'
rails3.1必须用ruby1.9去跑,然而1.9的编码处置非常2
必须文件头加上encoding才能顺利运行,否则就出现invalid multibyte char (US-ASCII) (SyntaxError)
当然,上面的配置在3.1中必然会报错,文件头也就是文件的第一行(new shit!!!),应该将# Load the rails application删掉,将encoding: utf-8放在第一行,fckkkkkkkkkkkkkk
本文探讨了在Rails 3.1中使用Ruby 1.9时遇到的编码问题,详细解释了如何通过在文件头部添加`encoding:utf-8`来解决`invalid multibyte char(US-ASCII)`错误,并提供了配置示例。
429

被折叠的 条评论
为什么被折叠?



