首页#index"\ xA9"中的Encoding :: InvalidByteSequenceError;在UTF-8上 [英] Encoding::InvalidByteSequenceError in Home#index "\xA9" on UTF-8

查看:259
本文介绍了首页#index"\ xA9"中的Encoding :: InvalidByteSequenceError;在UTF-8上的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是Ruby on Rails的新手,并且一直在与这个问题作斗争一段时间.

I'm new to Ruby on Rails, and have been battling with this issue for a while now.

我已从git中拉出一个网站,并确保已安装所有依赖项,但是,当我运行该网站时,出现错误消息:

I have pulled a website from git, and made sure all the dependencies are installed, however, when I run the site, I get the error:

ActionView :: Template :: Error(在UTF-8上为"\ xA9")

ActionView::Template::Error ("\xA9" on UTF-8)

因为该行使用代码image_path("bground2.jpg")链接图像.

because of the line linking images using the code image_path("bground2.jpg").

当我删除image_path("bground2.jpg")时,错误已解决.

When I remove the image_path("bground2.jpg"), the error is resolved.

但是我需要image_path("bground2.jpg"),没有它就不能做.

I however need image_path("bground2.jpg") and can't do without it.

我在这里尝试了解决方案,但似乎无法正常工作

这是index.html.erb文件的一部分,但是在包含image_pathimage_url的所有位置上都会重复出现该错误:

This is a section of the index.html.erb file, but the error is recurring over all places containing the image_path and image_url:

<%= provide(:title, 'Home') %>
  <section id="slider" class="">
    <div class="img-responsive" style="background-image: url(<%= image_path("bground2.jpg") %>); background-position: 50% 0;height: 500px;">
      <div class="container clearfix">
   <!-- <div class="slider-caption slider-caption-center">
     <!-- <div class="banner heading-block title-center nobottomborder">
            <h1><%= "#{t('.reach_home')}" %></h1>
          </div> --> 

推荐答案

因此,我通过重新安装Ruby应用程序解决了这个问题.

So, I solved this by reinstalling the Ruby application.

不知道是什么原因造成的,但我只是重新安装了该应用程序,并且一切正常.

Don't know what had caused it, but I just reinstalled the application and everything works fine.

谢谢大家的帮助.

这篇关于首页#index"\ xA9"中的Encoding :: InvalidByteSequenceError;在UTF-8上的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆