How to use the gem in the country

If you want to know Ruby,Ruby or want to install several software packages on your computer,You can easily use RubyGems a key to download - just like in the Ubuntu apt-get、Similar redhat in the yum etc.。

So,Want to install Ruby packages,You will need to gem。but,In addition to installing gem (if your computer is Linux or osx,It may have been built,Use the command "gem -v" to verify)

But it may not be the latest version (especially osx,xcode generally will not give you comes with the latest tools) so we need to upgrade it,at this time,You might encounter this error:

As for the reason it can not be found or a timeout It depends on the mood of the gfw。In short,this is a problem。

But the difficulty is that it seems even with vpn,gem is not how buy it (I do not rule out the issue of vpn),So,We must look for other solutions。

Replace mirroring

Ok,Since it is a package management tool,It is always a source of updates,I found a domestic Taobao update source,This update is a complete image of the source,Update frequency is synchronized once every 15 minutes,We use it to replace an official source。

Taobao Ali cloud image source is located on a server,The official source is located in the Amazon cloud,So you know。

Use the following command to change the gem update source:

Then you can try to update the version of the gem:

And then………………


Original article written by Gerber drop-off:R0uter's Blog » How to use the gem in the country

Reproduced Please keep the source and description link:

About the Author


The non-declaration,I have written articles are original,Reproduced, please indicate the link on this page and my name。

Leave a Reply

Your email address will not be published. Required fields are marked *