Ruby on Rails -无法将“\x89”从ASCII-8BIT转换为xxx/xxxx/xxxx的UTF-8

时间:2022-03-18 22:16:08

I am installing ruby on rails 4.0.0 on my linux system , but i am getting this kind of errors unable to convert "\x89" from ASCII-8BIT to UTF8 for guides/assets/images/getting_started/routing_error_no_route_matches.png, skipping and many similar errors , i read here that it won't cause any effect ,but i do not understand why it is coming . Any pointers?

我正在我的linux系统上安装ruby on rails 4.0.0,但是我得到了这样的错误,无法将“\x89”从ASCII-8BIT转换为UTF8,以获得指南/资产/图像/getting_started/ routing_no_route_matches。png,跳过和许多类似的错误,我在这里读到它不会产生任何影响,但我不明白它为什么会出现。指针吗?

3 个解决方案

#1


44  

You need to update / install a version of the rdoc gem that supports the conversion. Then these errors won't appear during generation of the documentation when you install rails or when you regenerate the documentation.

您需要更新/安装支持转换的rdoc gem版本。然后,当您安装rails或重新生成文档时,在生成文档时不会出现这些错误。

gem install rdoc

Then to regenerate the documentation

然后重新生成文档

gem rdoc --all --overwrite

#2


6  

Set such environment variables before you do install:

在安装之前设置这些环境变量:

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

#3


1  

If you prefer using online documentation to using rdoc and ri, then you can avoid these errors and speed up your installs by skipping the rdoc and ri installations. Michael Hartl recommends this in his book. Just add a .gemrc file to your home directory with the following contents:

如果您更喜欢使用在线文档而不是使用rdoc和ri,那么您可以通过跳过rdoc和ri安装来避免这些错误并加快安装速度。Michael Hartl在他的书中推荐了这一点。只需在主目录中添加.gemrc文件,内容如下:

install: --no-rdoc --no-ri
update: --no-rdoc --no-ri

#1


44  

You need to update / install a version of the rdoc gem that supports the conversion. Then these errors won't appear during generation of the documentation when you install rails or when you regenerate the documentation.

您需要更新/安装支持转换的rdoc gem版本。然后,当您安装rails或重新生成文档时,在生成文档时不会出现这些错误。

gem install rdoc

Then to regenerate the documentation

然后重新生成文档

gem rdoc --all --overwrite

#2


6  

Set such environment variables before you do install:

在安装之前设置这些环境变量:

export LANGUAGE=en_US.UTF-8
export LANG=en_US.UTF-8
export LC_ALL=en_US.UTF-8

#3


1  

If you prefer using online documentation to using rdoc and ri, then you can avoid these errors and speed up your installs by skipping the rdoc and ri installations. Michael Hartl recommends this in his book. Just add a .gemrc file to your home directory with the following contents:

如果您更喜欢使用在线文档而不是使用rdoc和ri,那么您可以通过跳过rdoc和ri安装来避免这些错误并加快安装速度。Michael Hartl在他的书中推荐了这一点。只需在主目录中添加.gemrc文件,内容如下:

install: --no-rdoc --no-ri
update: --no-rdoc --no-ri