Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gem install fails #2525

Closed
ffes opened this issue Sep 27, 2017 · 5 comments
Closed

gem install fails #2525

ffes opened this issue Sep 27, 2017 · 5 comments

Comments

@ffes
Copy link

ffes commented Sep 27, 2017

  • Your Windows build number: 10.0.15063

  • What you're doing and what's happening:

frank@pc247:~$ gem install jekyll
ERROR:  Could not find a valid gem 'jekyll' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Errno::EACCES: Failed to open TCP connection to api.rubygems.org:443 (Permission denied - connect(2) for "api.rubygems.org" port 443) (https://api.rubygems.org/specs.4.8.gz)
frank@pc247:~$ sudo gem install jekyll
[sudo] password for frank:
ERROR:  Could not find a valid gem 'jekyll' (>= 0), here is why:
          Unable to download data from https://rubygems.org/ - Errno::EACCES: Failed to open TCP connection to api.rubygems.org:443 (Permission denied - connect(2) for "api.rubygems.org" port 443) (https://api.rubygems.org/specs.4.8.gz)
  • Strace of the failing command, if applicable:
    strace.txt
@ghost
Copy link

ghost commented Sep 28, 2017

The command "gem install jekyll" works fine for me on my win10 laptop + ubuntu there. I use a custom compiled ruby in the prefix /Programs/Ruby/2.4.2 though.

From your strace it seems as if you probably use the default ubuntu ruby? Due to paths such as
"/usr/bin/gem", "/usr/local/lib/x86_64-linux-gnu/site_ruby/", "/var/lib/gems/2.3.0/", "/usr/lib/x86_64-linux-gnu/rubygems-integration/2.3.0/".

I used to have problems with the debian ruby - until I decided to no longer use debian ruby. From that day on, things fust work fine. Even on win10 - actually, the subsystem on win10 works better than the one-click .exe installer for me. ;)

If all else fails you can try to manually download the gem e. g. https://rubygems.org/downloads/jekyll-3.6.0.gem - need the other dependencies too, so this is a bit of a manual task, though you could automate it via a ruby script (simply obtain all remote URLs, then batch install them via that script).

Anyway, what I am saying here is that I do not think that this is the fault of the WSL team - I do not get a "Permission denied" error here, the gem install command just works fine for me. Hope that this information is at the least of some use to you, even if it does not directly resolve your issue - but I guess you also don't know why the connection is refused for you here. No idea how to easily find out what is blocking you there.

You can try a "gem install --user-install" but I guess this also probably won't work; manual download should work though. Easiest failsave installation then may be to "gem install --ignore-dependencies -no-ri -no-rdoc ./jekyll*.gem" once you downloaded that gem manually. .gem files are only archives anyway and can be extracted, with or without the "gem" utility. With gem it is "gem unpack *.gem"; without gem it may work via "tar -xvf " but there are also some pure-ruby solutions on the www available, but it is a bit more complicated to get them running. (The gem implementation itself is pure ruby, so you could use it ... but it is not the easiest code out there.)

@ffes
Copy link
Author

ffes commented Oct 25, 2017

Today I upgraded to Fall Creator Update, removed the old "Bash on Ubuntu on Windows", installed "Ubuntu" from the store and now it just works. So I'm closing this one.

@ffes ffes closed this as completed Oct 25, 2017
@ronnelson
Copy link

For me the problem was that the attempted connection/download from https://rubygems.org/ was trying ipv6. disabling that protocol cleared the problem up completely.

@dustintheweb
Copy link

For me the problem was that the attempted connection/download from https://rubygems.org/ was trying ipv6. disabling that protocol cleared the problem up completely.

Solved my issue on WSL. If you've tried everything else, try this: https://askubuntu.com/a/1013248

@rcarroll98
Copy link

I solved it by disabling Hamachi in Network Connections.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants