3

我刚刚完成了 michael hartl 关于 rails 3.2 的教程,并决定尝试一个开源项目并选择了这个。我已经安装了 gems,更新了 bundler,当我尝试启动服务器时,出现以下错误。如何解决这个问题?

    ashku@ashku-Lenovo-G470:/media/ashku/New Volume/RoR/ecom$ rails s
/home/ashku/.rvm/gems/ruby-1.9.3-p448@ror_ecommerce/gems/railties-3.2.11/lib/rails/commands.rb:53:in `require': /media/ashku/New Volume/RoR/ecom/config/application.rb:1: Invalid char `\x01' in expression (SyntaxError)
/media/ashku/New Volume/RoR/ecom/config/application.rb:1: invalid multibyte char (US-ASCII)
    from /home/ashku/.rvm/gems/ruby-1.9.3-p448@ror_ecommerce/gems/railties-3.2.11/lib/rails/commands.rb:53:in `block in <top (required)>'
    from /home/ashku/.rvm/gems/ruby-1.9.3-p448@ror_ecommerce/gems/railties-3.2.11/lib/rails/commands.rb:50:in `tap'
    from /home/ashku/.rvm/gems/ruby-1.9.3-p448@ror_ecommerce/gems/railties-3.2.11/lib/rails/commands.rb:50:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'
4

1 回答 1

3

添加

# encoding: UTF-8

在 config/application.rb 文件的顶部。

于 2013-10-08T08:01:24.337 回答