Last Updated: February 25, 2016
· boris
Beer avatar


Today I found following error while bootstrapping a new chef client machine: ERROR:  While executing gem ... (RuntimeError)     gem update --system is disabled on Debian, because it will overwrite the content of the rubygems Debian package, and might break your Debian system in subtle ways. The Debian-supported way to update rubygems is through apt-get, using Debian official repositories. If you really know what you are doing, you can still update rubygems by setting the REALLY_GEM_UPDATE_SYSTEM environment variable, but please remember that this is completely unsupported by Debian. GET 302 Moved Temporarily

It's clearly a weird behaviour that happens when following componentes are mixed: Chef, Ubuntu 12.04, Ruby 1.9.

To solve it, I made this modification on my ubuntu's bootstrap file:

--- ubuntu12.04_ruby1.9.1_bootstrap_PRE.erb     2013-05-22 14:00:28.260592253 +0000
+++ ubuntu12.04_ruby1.9.1_bootstrap.erb 2013-05-22 13:22:46.653543721 +0000
@@ -6,11 +6,11 @@
-gem update --system gem update --system --no-rdoc --no-ri
+REALLY_GEM_UPDATE_SYSTEM=yes sudo -E gem update --system gem update --system --no-rdoc --no-ri

Enjoy and share :)

Say Thanks

2 Responses
Add your response


Could you some detailed information?

over 1 year ago ·
Beer avatar

@maksadbek hi, what kind of detailed information de you need? I just passed a variable before running gem update on a Debian-like system.

Let me know if I wasn't clear enough.

over 1 year ago ·