error installing RDoc documentation: incompatible encoding regexp match

假如想象 提交于 2019-12-04 11:48:25

问题


Over the last week, on a few gem install or gem update operations, I've received an error similar to these:

ERROR:  While generating documentation for sinatra-1.3.1 ... MESSAGE:   error generating C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/doc/sinatra-1.3.1/rdoc/README_de_rdoc.html: incompatible encoding regexp match (UTF-8 regexp with IBM437 string) (Encoding::CompatibilityError)

similarly:

ERROR:  While generating documentation for rest-client-1.6.7 ... MESSAGE:   error generating C:/RailsInstaller/Ruby1.9.2/lib/ruby/gems/1.9.1/doc/rest-client-1.6.7/rdoc/README_rdoc.html: incompatible encoding regexp match (UTF-8 regexp with IBM437 string) (Encoding::CompatibilityError)

and possibly one other place. I've read up on this but don't find a solution for code I did not write and data I don't control. Any idea how to fix this?


回答1:


I had a similar problem on Ubuntu and updating rubygems itself solved the problem for me. You can do that by entering the following at the command line:

gem update --system

Also, you can always skip the doc generation by using:

--no-rdoc --no-ri

when installing the gem.




回答2:


On Windows, this worked for me:

> set RDOCOPT="--encoding=UTF-8"
> gem install heroku



回答3:


michael.rp almost had it, but no quotes on the environment string for Windows. The same solution for Linux appears in the link supplied by jerry. For Windows:

set RDOCOPT=--encoding=UTF-8

I put this in the RubyInstaller\Ruby1.9.3\setup_environment.bat file so it is always there.



来源:https://stackoverflow.com/questions/7897101/error-installing-rdoc-documentation-incompatible-encoding-regexp-match

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!