I tried to update gem behind a proxy and got the following error message:
sudo gem update --system
ERROR: While executing gem ... (Gem::RemoteFetcher::FetchError)
Errno::ETIMEDOUT: Connection timed out - connect(2) for "api.rubygems.org" port 443 (https://api.rubygems.org/specs.4.8.gz)
Though the http_proxy and https_proxy (also in upper case) was set it didn’t work. Trying to set the proxy directly in the command did the trick:
sudo gem update --http-proxy=<the proxy> --system
If “rails g” just hangs a simple
could be the solution.
Extracting libxml2-2.9.2.tar.gz into tmp/x86_64-suse-linux-gnu/ports/libxml2/2.9.2… OK
Running patch with /usr/lib64/ruby/gems/2.1.0/gems/nokogiri-18.104.22.168/ports/patches/libxml2/0001-Revert-Missing-initialization-for-the-catalog-module.patch…
Running ‘patch’ for libxml2 2.9.2… ERROR, review ‘/usr/lib64/ruby/gems/2.1.0/gems/nokogiri-22.214.171.124/ext/nokogiri/tmp/x86_64-suse-linux-gnu/ports/libxml2/2.9.2/patch.log’ to see what happened.
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
The mentioned log tells us that patch executable is not installed. Fixed by:
sudo zypper in patch
sudo zypper in zlib-devel
To remove all installed gems that are removable, simply use the following statement:
for x in `gem list --no-versions`; do gem uninstall $x -a -x -I; done