Rails 整合 refinerycms 到项目中遇到 encoding 问题

raymondos · 2013年09月11日 · 最后由 xds2000 回复于 2014年01月25日 · 2895 次阅读

运行

rails generate refinery:cms

遇到如下错误:

/Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/thor-0.18.1/lib/thor/actions/file_manipulation.rb:233:in `gsub!': 
incompatible encoding regexp match (UTF-8 regexp with ASCII-8BIT string) (Encoding::CompatibilityError)
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/thor-0.18.1/lib/thor/actions/file_manipulation.rb:233:in `gsub_file'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/refinerycms-core-2.1.0/lib/generators/refinery/cms/cms_generator.rb:178:in `block in ensure_environments_are_sane!'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/refinerycms-core-2.1.0/lib/generators/refinery/cms/cms_generator.rb:160:in `each'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/refinerycms-core-2.1.0/lib/generators/refinery/cms/cms_generator.rb:160:in `ensure_environments_are_sane!'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/refinerycms-core-2.1.0/lib/generators/refinery/cms/cms_generator.rb:25:in `generate'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/thor-0.18.1/lib/thor/command.rb:27:in `run'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/thor-0.18.1/lib/thor/invocation.rb:120:in `invoke_command'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `block in invoke_all'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `each'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `map'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/thor-0.18.1/lib/thor/invocation.rb:127:in `invoke_all'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/thor-0.18.1/lib/thor/group.rb:233:in `dispatch'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/thor-0.18.1/lib/thor/base.rb:439:in `start'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/railties-3.2.13/lib/rails/generators.rb:171:in `invoke'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/railties-3.2.13/lib/rails/commands/generate.rb:12:in `<top (required)>'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `block in require'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:236:in `load_dependency'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/activesupport-3.2.13/lib/active_support/dependencies.rb:251:in `require'
    from /Users/admin/.rvm/gems/ruby-2.0.0-p195@rails200/gems/railties-3.2.13/lib/rails/commands.rb:29:in `<top (required)>'
    from script/rails:6:in `require'
    from script/rails:6:in `<main>'

求如何破?

需要 登录 后方可回复, 如果你还没有账号请 注册新账号