I am trying to install rails using the following command:
sudo gem install railsand get the following error:
ERROR: Could not find a valid gem 'rails' (>= 0) in any repository
ERROR: Possible alternatives: railsI am using:
- Ubuntu 12.04 LTS
My Ruby version is ruby
1.9.3p0 (2011-10-30 revision 33570) [x86_64-linux]My gem version is
$gem -v 1.8.11
I have try some things that I found in the net like trying to update my gem version using the following command:
gem update --systembut it throws me un error again:
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.Could you advice what should i try?
1 Answer
I have fixed this issue using the proxy command option of gem install. It has the following format:
$ gem install --http-proxy railsNote, the IP address and the port number refers to a proxy. You should search for a proxy list and use one of the proxies there.
This is site with proxies:
Also, I have to try 7 or 8 different proxies in order to succeed. Do not give up.
Note, you could see the following error, too:
ERROR: While executing gem ... (Gem::DependencyError) Unable to resolve dependencies: rails requires activesupport (= 3.2.8), actionpack (= 3.2.8), activerecord (= 3.2.8), activeresource (= 3.2.8), actionmailer (= 3.2.8), railties (= 3.2.8), bundler (~> 1.0)Don't give up and continue with the next proxy from the list. Good luck.