Installing a Discourse development environment when behind a proxy

(Marco) #1

I wanted to install a local Discourse environment, but since I’m behind an authenticated proxy I’m having all sorts of troubles. Maybe these notes can be of some help to others with the same starting conditions as mine.

I’m following the instructions here:

Steps 1, 2 and 3 completed succesfully, even if the screenshots in step 3 are outdated. The cloning button is not “Clone in Windows” but “Clone in Desktop” at it is at the right hand of the screen:

Step 4 didn’t work.
First, install the vagrant proxy plugin. In the Windows shell, issue:

SET http_proxy="http://user:password@host:port"

In Unix:

export http_proxy="http://user:password@host:port"

Then in both cases issue:

vagrant plugin install vagrant-proxyconf

Now set the Vagrant proxy, in Windows:

SET VAGRANT_HTTP_PROXY="http://user:password@proxy:port" 


export VAGRANT_HTTP_PROXY="http://user:password@proxy:port" 

Now you have to download the Vagrant box manually: the proxy didn’t work for me. So navigate with your browser to:

It will start downloading the vagrant disourse box, when it finishes, move the dowloaded file in the directory where your Vagrantfile resides.

You can now add the vagrant box, in the shell:

vagrant box add discourse-

And install it:

vagrant up

Now enter in the virtual machine:

vagrant ssh

Now set the http proxy again (you’re now in the Linux virtual machine):

export http_proxy="http://user:password@host:port"
export https_proxy=$http_proxy


bundle install

I’m stuck here, this is the error I get:

Fetching source index from
Retrying source fetch due to error (2/3): Bundler::HTTPError Could not fetch specs from

How do I proceed?

(Sam Saffron) #2

I think you need to specify the proxy for rubygems

(Teemu Matilainen) #3

That’s a bit strange, as setting the HTTP/S_PROXY variables should be enough for Bundler. And I’ve definitely used vagrant-proxyconf with Bundler on the VM…

One thing is that the quoting for Windows environment variable setting is incorrect. In many cases you don’t even need it, or it should be e.g.

SET "http_proxy=http://user:password@host:port"