Skip to content

Instantly share code, notes, and snippets.

@yevgenko
Last active July 22, 2019 13:42
Show Gist options
  • Save yevgenko/774b4835683d81e761e73eaae34cfe70 to your computer and use it in GitHub Desktop.
Save yevgenko/774b4835683d81e761e73eaae34cfe70 to your computer and use it in GitHub Desktop.

The Problem

bundle install
> Fetching source index from https://rails-assets.org/
> 
> Retrying fetcher due to error (2/4): Bundler::HTTPError Could not fetch specs from https://rails-assets.org/
> Retrying fetcher due to error (3/4): Bundler::HTTPError Could not fetch specs from https://rails-assets.org/
> Retrying fetcher due to error (4/4): Bundler::HTTPError Could not fetch specs from https://rails-assets.org/
> Could not fetch specs from https://rails-assets.org/
wget https://rails-assets.org/
> --2019-07-22 14:22:02--  https://rails-assets.org/
> Resolving rails-assets.org... 198.54.117.197, 198.54.117.198, 198.54.117.199, ...
> Connecting to rails-assets.org|198.54.117.197|:443... failed: Connection refused.
> Connecting to rails-assets.org|198.54.117.198|:443... failed: Connection refused.
> Connecting to rails-assets.org|198.54.117.199|:443... failed: Connection refused.
> Connecting to rails-assets.org|198.54.117.200|:443... failed: Connection refused.

Solution

Using proxy server on a different network from which rails-assets still available.

For example, I've been using server instance in San Francisco data center via https://cloud.digitalocean.com Also tried Frankfurt region, but rails-assets still wasn't available to that region.

Check if rails-assets available to remote computer, should return 200 OK:

wget https://rails-assets.org/
> --2019-07-22 13:19:26--  https://rails-assets.org/
> Resolving rails-assets.org (rails-assets.org)... 192.241.135.61
> Connecting to rails-assets.org (rails-assets.org)|192.241.135.61|:443... connected.
> HTTP request sent, awaiting response... 200 OK
> Length: unspecified [text/html]
> Saving to: ‘index.html’
>
> index.html                                       [ <=>                                                                                         ]   4.18K  --.-KB/s    in 0s
> 
> 2019-07-22 13:19:27 (79.9 MB/s) - ‘index.html’ saved [4281]

Create SOCKS proxy:

ssh -D 1080 -C -q -N root@CHANGE_ME_TO_IP

Install gems via proxy:

gem install csocksify
csocksify -g bundler bundle install
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment