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

offline bundling w/gemstash fails due to unreachable rubygems.org #133

Open
jm3 opened this issue Jan 23, 2017 · 7 comments
Open

offline bundling w/gemstash fails due to unreachable rubygems.org #133

jm3 opened this issue Jan 23, 2017 · 7 comments

Comments

@jm3
Copy link

jm3 commented Jan 23, 2017

The instructions for verifying that gemstash caching enables offline bundling (within the 30 minute cache window) aren't working for me. When I disable internet access and then delete the Gemfile.lock and .bundle/ dir as suggested for testing, bundling fails since rubygems.org is unreachable:

% rm -rf Gemfile.lock .bundle
% bundle
Could not reach host index.rubygems.org. Check your network connection and try again.

The README suggests that this should have worked because the local gemstash server should field the requests, right? Gemstash otherwise is working fine, just not offline. (I didn't wait longer than 30 minutes so the metadata should still be in cache.)

When I re-enable internet, bundling against the local gemstash works fine:

% bundle
Fetching gem metadata from http://localhost:9292/...............
Fetching version metadata from http://localhost:9292/.
Resolving dependencies...
Using puma 3.6.2
Using rubywarrior 0.1.3
Using wirble 0.1.3
Using bundler 1.13.7
Bundle complete! 3 Gemfile dependencies, 4 gems now installed.
Use `bundle show [gemname]` to see where a bundled gem is installed.

Am I forgetting / missing something?

ruby: 2.4.0, gemstash: 1.0.3

@smellsblue
Copy link
Contributor

@jm3 thanks for the detailed analysis! Based on the messages, I suspect it might be because we haven't yet implemented the bundler index, which is the newer API that Bundler now uses. I'm hoping we can fix this with the new index, and maybe even improve things a bit.

@jm3
Copy link
Author

jm3 commented Jan 23, 2017

Gotcha! Sounds like this is waiting on #72

@bbuchalter
Copy link

Has there been any progress on this issue? Perhaps it'd be best to update the README until this is resolved?

@michaeldever
Copy link

Any update on this issue?

@aesyondu
Copy link

aesyondu commented Apr 6, 2021

I have a similar issue. I'm using the govuk/gemstash-alpine

When the internet is up, the docker container seems to be working.

[2021-04-06 14:42:55 +0000] - INFO - Gem racc-1.5.2 exists, returning cached gem
[2021-04-06 14:42:55 +0000] - INFO - Gem crass-1.0.6 exists, returning cached gem

But when I turn it off:

Could not fetch specs from http://gemcache:9292/ due to underlying error <no
such name (http://gemcache:9292/specs.4.8.gz)>
The command '/bin/sh -c bundle install' returned a non-zero code: 17

Info:

/ # gemstash --version
Gemstash version 2.0.0
/ # ruby --version
ruby 2.4.6p354 (2019-04-01 revision 67394) [x86_64-linux-musl]

@dolan
Copy link

dolan commented Apr 6, 2023

Is this still an issue? Does gemstash actually work when rubygems is offline/internet disabled? It looks to me, from reading this issue and comments that it does not. Is that still right?

@Derwaan
Copy link

Derwaan commented Aug 4, 2023

This is indeed still an issue. With Gemstash version 2.2.2, I've tried fetching gems while offline and I keep having the same error message:

$ rm -rf Gemfile.lock .bundle
$ bundle install --path .bundle
Could not reach host index.rubygems.org. Check your network connection and try again.

Everything works fine when back online.
As for today, it appears to me that Gemstash can't be used as a full-offline Gems cache.

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

No branches or pull requests

8 participants