2

I'm trying to install rails in my Arch Linux computer. I'm running into network problems that I know that have already appeared here. I didn't find a satisfactory answer anywhere.

Since everytime I try, gem fails downloading a different gem (I think all are dependencies of rails), I want to try to download these separately, and only when I have all installed, try to install rails again.

This is what is looks to try to install rails:

[lurch ~]$ time gem install rails
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ETIMEDOUT: Connection timed out - connect(2) for "api.rubygems.org" port 443 (https://api.rubygems.org/api/v1/dependencies?gems=rails-html-sanitizer)

real    4m59.698s
user    0m1.170s
sys     0m0.117s


[lurch ~]$ gem install rails
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ETIMEDOUT: Connection timed out - connect(2) for "api.rubygems.org" port 443 (https://api.rubygems.org/quick/Marshal.4.8/thread_safe-0.3.4.gemspec.rz)


[lurch ~]$ gem install rails
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ETIMEDOUT: Connection timed out - connect(2) for "api.rubygems.org" port 443 (https://api.rubygems.org/api/v1/dependencies?gems=i18n)


[lurch ~]$ time gem install rails
ERROR:  While executing gem ... (Gem::RemoteFetcher::UnknownHostError)
    no such name (https://api.rubygems.org/api/v1/dependencies?gems=bundler)

real    1m28.495s
user    0m0.883s
sys     0m0.083s


[lurch ~]$ gem update --system
ERROR:  While executing gem ... (Gem::RemoteFetcher::FetchError)
    Errno::ETIMEDOUT: Connection timed out - connect(2) for "s3.amazonaws.com" port 443 (https://api.rubygems.org/specs.4.8.gz)

Now, my question is: where can I get a list of all gem dependencies of rails? The gem dependency command doesn't work:

[lurch ~]$ gem dependency rails     
No gems found matching rails (>= 0)

In fact, this documentation page describes the gem dependency command as [emphasis mine] "Show the dependencies of an installed gem".

So, just to be clear, my question is: How to get a list of all gem dependencies of some specific gem? Of course, if someone manages to solve the strange network problem in the command gem install rails, I will be very happy also.

EDIT: version information

[lurch ~]$ uname -a
Linux lurch 3.17.6-1-ARCH #1 SMP PREEMPT Sun Dec 7 23:43:32 UTC 2014 x86_64 GNU/Linux
[lurch ~]$ gem --version
2.2.2
[lurch ~]$ ruby --version
ruby 2.1.5p273 (2014-11-13 revision 48405) [x86_64-linux]
Community
  • 1
  • 1
fonini
  • 2,989
  • 3
  • 21
  • 39
  • It doesn't show the dependencies because the rails gem is not installed. Did you `bundle install`? – B Seven Dec 29 '14 at 22:52
  • It seems that the network problems are not associated with Rails. Once you solve that you'll be able to install gems and see the dependencies. – B Seven Dec 29 '14 at 22:53
  • Which version of gem are you using? – B Seven Dec 29 '14 at 23:05
  • I did mention in my question (and in its title) that the dependencies doesn't show because `rails` is no installed. Also, I cannot run `bundle install` because I can't install _any_ gem. – fonini Dec 29 '14 at 23:48
  • That's the same version of RubyGems that I have. – B Seven Dec 30 '14 at 00:15

2 Answers2

4

I know that this is a bit of a necro, but I think that you can use gem install --explain rails.

from http://guides.rubygems.org/command-reference/#gem-install

-​-explain - Rather than install the gems, indicate which would be installed

You may have to run that command from another system that CAN access the rubygems.org server, get the list of gems, pull them down, and install them on your system instead of hitting rubygems directly (till you get your network problem figured out)

Cinderhaze
  • 332
  • 3
  • 11
3

Found the real answer to the question: RubyGems.org

gem dependency rails
Gem rails-4.1.6
  actionmailer (= 4.1.6)
  actionpack (= 4.1.6)
  actionview (= 4.1.6)
  activemodel (= 4.1.6)
  activerecord (= 4.1.6)
  activesupport (= 4.1.6)
  bundler (< 2.0, >= 1.3.0)
  railties (= 4.1.6)
  sprockets-rails (~> 2.0)

or Gemfile.lock

rails (4.1.6)
  actionmailer (= 4.1.6)
  actionpack (= 4.1.6)
  actionview (= 4.1.6)
  activemodel (= 4.1.6)
  activerecord (= 4.1.6)
  activesupport (= 4.1.6)
  bundler (>= 1.3.0, < 2.0)
  railties (= 4.1.6)
  sprockets-rails (~> 2.0)
B Seven
  • 44,484
  • 66
  • 240
  • 385
  • I don't understand anything. Is this the output you get when you run `gem dependency rails` in your machine? Are these the only gem dependencies of the `rails` gem? What is Gemfile.lock, a file? I can't find this file in my system. Also, why do the informations in this "Gemfile.lock" and in `gem dependency` differ? – fonini Dec 29 '14 at 23:52
  • Am I right in talking about "gem dependencies"? I have the impression that gems have gem dependencies (that are managed by the rubygems program) because when I try to install `rails`, it fails because it's not able to reach a URL that ends with `dependencies?gems=...` – fonini Dec 29 '14 at 23:58
  • Yes, the first part is what I get running `gem dependency rails`. Yes, these are the only dependencies of the rails gem. A Gemfile.lock is generated after running `bundle install`. The information differed because I got the dependencies for another gem. I've updated the answer. – B Seven Dec 30 '14 at 00:14
  • 1
    Thanks. Anyway, `gem install rails` worked fine after I tried it the tenth time. :P – fonini Dec 30 '14 at 00:15
  • Many times, the solution is to keep re-running the command until the overloaded rubygems server(s) finally responds - "bundle install" - over and over and over until you finally get all the gems installed. When the activity stops in the console, and no bandwidth is being delivered for a few secs, stop and re-run the command. This causes the server to have to re-load the metadata again, but since no retry happens, you are just waiting for the inevitable timeout error. – JosephK Apr 16 '16 at 09:06