Bathakarai
Bathakarai

Reputation: 1537

ERROR: Could not find a valid gem 'rails' (>= 0) in any repository

I installed rvm and ruby successfully in a linux environment. When I try to install rail, that time I face following error:

$ gem install rails
/home/bathakarai/.rvm/rubies/ruby-1.9.3-p385/bin/gem:4: warning: Insecure world writable dir /home/bathakarai in PATH, mode 040777
ERROR:  Could not find a valid gem 'rails' (>= 0) in any repository
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::EHOSTUNREACH: No route to host - connect(2) (http://rubygems.org/latest_specs.4.8.gz)

My gem version is

1.8.25

Rvm version is "rvm 1.18.19 (stable) by Wayne E. Seguin , Michal Papis [https://rvm.io/]".

Please help me by letting me know why this error occurs.

Upvotes: 1

Views: 8766

Answers (6)

Sammy1688
Sammy1688

Reputation: 21

You should try disabling your IPV6 to install the required Gem file since the rails fetcher could not locate the source. If you are using a linux machine, you can check this link for the steps on how to disable your IPV6 https://www.linuxbabe.com/ubuntu/disable-ipv6-on-ubuntu

Upvotes: 0

user1857492
user1857492

Reputation: 767

I have struggled to install rails for two days (I've been getting almost the same error message, but, without that "Insecure world ..." line). And at last I did it using the script below (provided at RailsGirls):

bash < <(curl -sL https://raw.github.com/railsgirls/installation-scripts/master/rails-install-ubuntu.sh)

I don't know why it worked. Just leaving it here with the hope that it will be helpful for some other soul as well. ;P

Upvotes: 0

Thant Shwe Aung
Thant Shwe Aung

Reputation: 656

You can use to install with below command

gem install rails --source http://rubygems.org

Upvotes: 3

ormizd
ormizd

Reputation: 1

In my case the culprit was avast! Internet Security software on my MacBook Pro. I went to System Preferences, clicked on avast!, clicked on the lock to enable changes, and disabled the Web Shield and File System shield.

After that, I was able to install gems.

Upvotes: 0

Bathakarai
Bathakarai

Reputation: 1537

Yes, Finally I got the result. It seems like some sort of proxy problem. I set the proxy using export "$HTTP_PROXY=IPAddress which is given in browser:portnumber". For any reference http://khylo.blogspot.in/2007/12/ruby-on-rails-headaches.html

Upvotes: 1

muttonlamb
muttonlamb

Reputation: 6491

Try running

sudo gem install rails

This may overcome the permission problem you are having

You also look to be having an internet connectivity problem based on the error message.

Upvotes: 0

Related Questions