如何解决“ActionView :: Template :: Error(UTF-8中的无效字节序列):”

问题描述 投票:1回答:1

专家介绍,

我正在按照一本书的例子在RoR上构建我的第一个博客系统。我的操作系统是Win10,Ruby是2.4.2p198,Rails是5.1.4。激活Rails服务器后,我连接到localhost:3000 / users。然后我遇到以下错误:

用户中的ArgumentError #index显示C:/Users/joeychou/hello_rails/app/views/layouts/application.html.erb第7行引发:

UTF-8中的无效字节序列

它突出显示错误行如下:

在rails服务器上,错误消息如下:

ActionView :: Template :: Error(UTF-8中的无效字节序列):4:HelloRails 5:<%= csrf_meta_tags%> 6:7:<%= stylesheet_link_tag'application',media:'all','data-turbolinks -track':'reload'%> 8:<%= javascript_include_tag'application','data-turbolinks-track':'reload'%> 9:10:

app / views / layouts / application.html.erb:7:在`_app_views_layouts_application_html_erb___655117387_94495480'

请告知如何解决这个问题,以便我继续前进。任何帮助深表感谢!

问候,乔伊

utf-8 ruby-on-rails-5.1 argument-error
1个回答
0
投票

我找到了答案!

coffee-script source> = 1.9.0在Windows下无法正常运行。你可以这样做:gem'coffee-script-source','1.8.0'强制1.8.0然后发出bundle update coffee-script-source

有关详细信息,请参阅以下链接。 Rails ExecJS::ProgramError in Pages#home?

© www.soinside.com 2019 - 2024. All rights reserved.