The following error is always reported when you install the gem.
WARNING: RubyGems 1.2 + index not found:
RubyGems will revert to legacy indexes degrading performance.
Or the gem install is too slow or cannot be connected to timeout.
You can install gem locally.
First go to the gem official website http://rubygems.org/
Search for the gem you want to install and download it.
Should be a file like a rails-3.0.gem
Then execute the gem install-l rails-3.0.gem
-L the parameter indicates that the local installation is directly executed.
If the gem does not have a dependency package, the installation is successful.
If a dependency package exists, an error is returned, indicating that the dependent gem is missing.
And then download the package again, gem install-l xxx. gem
Although the installation is not convenient, it is very fast.
If you want to install a new machine, you only need to put all the dependent packages in one folder and install all the packages in sequence, which will save a lot of time and do not necessarily require Internet connection.