Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"Gem::RemoteFetcher::UnknownHostError" while installing Rails version 3.2.15

i've successfully installed rails 3.2.15 on a live ubuntu usb with data persistence before.

now that i've become used to the os (Ubuntu 12.04 LTS), i've installed it on the laptop and in the process of installing the stuff i used back in the live usb.

long story short, i'm having problems with installing Rails. i've used the same instructions to install ruby and rails as the one in the live usb: http://ryanbigg.com/2010/12/ubuntu-ruby-rvm-rails-and-you/

However, i'm getting this error when installing rails:

ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError) no such name (https://api.rubygems.org/api/v1/dependencies?gems=activemodel)

I've used -V to see what's happening but, being a tech noob in general, i dont know whats going wrong.

Here's what -V gave out:

~$ gem install rails -V 3.2.15 HEAD https://api.rubygems.org/latest_specs.4.8.gz 302 Moved Temporarily HEAD https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz 200 OK GET https://api.rubygems.org/latest_specs.4.8.gz 302 Moved Temporarily GET https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz 200 OK HEAD https://api.rubygems.org/latest_specs.4.8.gz 302 Moved Temporarily HEAD https://s3.amazonaws.com/production.s3.rubygems.org/latest_specs.4.8.gz 304 Not Modified GET https://api.rubygems.org/quick/Marshal.4.8/rails-4.0.2.gemspec.rz 302 Moved Temporarily GET https://bb-m.rubygems.org/quick/Marshal.4.8/rails-4.0.2.gemspec.rz 200 OK HEAD https://api.rubygems.org/api/v1/dependencies 302 Moved Temporarily HEAD https://bundler.rubygems.org/api/v1/dependencies 200 OK HEAD https://api.rubygems.org/api/v1/dependencies 302 Moved Temporarily HEAD https://bundler.rubygems.org/api/v1/dependencies 200 OK GET https://api.rubygems.org/api/v1/dependencies?gems=rails 302 Moved Temporarily GET https://bundler.rubygems.org/api/v1/dependencies?gems=rails 200 OK GET https://api.rubygems.org/api/v1/dependencies?gems=rails 302 Moved Temporarily GET https://bundler.rubygems.org/api/v1/dependencies?gems=rails 200 OK GET https://api.rubygems.org/api/v1/dependencies?gems=railties 302 Moved Temporarily GET https://bundler.rubygems.org/api/v1/dependencies?gems=railties 200 OK GET https://api.rubygems.org/api/v1/dependencies?gems=railties 302 Moved Temporarily GET https://bundler.rubygems.org/api/v1/dependencies?gems=railties 200 OK GET https://api.rubygems.org/api/v1/dependencies?gems=actionmailer 302 Moved Temporarily GET https://bundler.rubygems.org/api/v1/dependencies?gems=actionmailer 200 OK GET https://api.rubygems.org/api/v1/dependencies?gems=actionmailer 302 Moved Temporarily GET https://bundler.rubygems.org/api/v1/dependencies?gems=actionmailer 200 OK GET https://api.rubygems.org/api/v1/dependencies?gems=activerecord 302 Moved Temporarily GET https://bundler.rubygems.org/api/v1/dependencies?gems=activerecord 200 OK GET https://api.rubygems.org/api/v1/dependencies?gems=activerecord 302 Moved Temporarily GET https://bundler.rubygems.org/api/v1/dependencies?gems=activerecord 200 OK GET https://api.rubygems.org/api/v1/dependencies?gems=actionpack 302 Moved Temporarily GET https://bundler.rubygems.org/api/v1/dependencies?gems=actionpack 200 OK GET https://api.rubygems.org/api/v1/dependencies?gems=actionpack 302 Moved Temporarily GET https://bundler.rubygems.org/api/v1/dependencies?gems=actionpack 200 OK GET https://api.rubygems.org/api/v1/dependencies?gems=activesupport 302 Moved Temporarily GET https://bundler.rubygems.org/api/v1/dependencies?gems=activesupport 200 OK GET https://api.rubygems.org/api/v1/dependencies?gems=activesupport 302 Moved Temporarily GET https://bundler.rubygems.org/api/v1/dependencies?gems=activesupport 200 OK GET https://api.rubygems.org/api/v1/dependencies?gems=activemodel 302 Moved Temporarily GET https://bundler.rubygems.org/api/v1/dependencies?gems=activemodel 200 OK ERROR: While executing gem ... (Gem::RemoteFetcher::UnknownHostError) no such name (https://api.rubygems.org/api/v1/dependencies?gems=activemodel)

anyone can help?

ADDITIONAL INFO:

using:

ruby 2.1.0p0 (2013-12-25 revision 44422) [i686-linux]

rvm 1.25.15 (stable) by Wayne E. Seguin , Michal Papis [https://rvm.io/]

like image 711
osse Avatar asked Jan 26 '14 13:01

osse


2 Answers

probably got the error because internet at home was quite intermittent. When i used the internet connection at work, the install went well.

like image 62
osse Avatar answered Nov 02 '22 23:11

osse


I had the same problem: Ubuntu 12.04, ruby 2.1.0 trying to install latest rails (4.0.x). Doing gem install rails I was getting same error. What I did:

  • update rubygem: gem update --system and it went from 2.2.0 to 2.2.2
  • located outdated gems (gem outdated) and got several outdated: bigdecimal (1.2.3 < 1.2.5), minitest (4.7.5 < 5.2.3), psych (2.0.2 < 2.0.4), rake (10.1.0 < 10.1.1), rdoc (4.1.0 < 4.1.1), test-unit (2.1.0.0 < 2.5.5)
  • updated gems with gem update
  • Sucessfully installed rails with gem install rails --no-ri --no-rdoc

At rails -v I got Rails 4.0.3.

like image 19
Luis Capriles Avatar answered Nov 03 '22 00:11

Luis Capriles