error installing RDoc documentation: incompatible encoding regexp match
Asked Answered
E

3

9

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?

Exceptional answered 25/10, 2011 at 23:37 Comment(0)
E
5

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.

Exceptional answered 16/5, 2012 at 17:43 Comment(1)
I don't have such file (setup_environment.bat). Can you help me?Mernamero
S
7

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.

Statampere answered 8/11, 2011 at 9:40 Comment(1)
This did work for me. Another solution, which I did not try, was offered here: github.com/rails/rails/issues/3743#issuecomment-3340507Ella
I
5

On Windows, this worked for me:

> set RDOCOPT="--encoding=UTF-8"
> gem install heroku
Intelligence answered 16/5, 2012 at 5:25 Comment(1)
You solution still failed on an update to Sinatra--until I removed the quotes from the environment string. I had to uninstall and reinstall Sinatra to get the RDoc install to be reattempted, but it then worked.Exceptional
E
5

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.

Exceptional answered 16/5, 2012 at 17:43 Comment(1)
I don't have such file (setup_environment.bat). Can you help me?Mernamero

© 2022 - 2024 — McMap. All rights reserved.