(issues) lib/issues/github_issues.ex:14: Issues.GithubIssues.handle_response({:error, %HTTPoison.Error{id: nil, reason: :connect_timeout}})

Problem

Trying to follow the example in ‘Programming Elixir 1.2’ for fetching the issues from Github you are getting the following error:

(issues) lib/issues/github_issues.ex:14: Issues.GithubIssues.handle_response({:error, %HTTPoison.Error{id: nil, reason: :connect_timeout}})

Solution

You are quite likely behind a proxy and you get a timeout. Add the proxy details to the HTTPoison.get request as follows:

iex(4)> HTTPoison.get!( "https://api.github.com/repos/elixir-lang/elixir", [], [{:proxy, "your_proxy_ip:your_proxy_port"}])

And you could make the following change to the github_issues.ex file to be able to work with the proxy:

def fetch(user, project, proxy) do
  issues_url(user, project)
  |> HTTPoison.get(@user_agent, proxy)
  |> handle_response
end

So you can call it like the following from iex:

iex(1)> Issues.GithubIssues.fetch("elixir-lang", "elixir", [{:proxy, "your_proxy_ip:your_proxy_port"}])

Request failed (404) ** (Mix) Package fetch failed and no cached copy available

Problem

You are trying to use hex for installing dependencies but when you are behind a proxy you get the following message:

Request failed (404)
** (Mix) Package fetch failed and no cached copy available

Solution

You can use the following to set up hex (taken from the answer here:

mix hex.config http_proxy http://proxy.mycompany.com

SSL received a record that exceeded the maximum permissible length.

Problem

You want to install rbenv, but when you are trying to clone the code with:

git clone https://github.com/rbenv/rbenv.git ~/.rbenv

you get the following error:

fatal: unable to access 'https://github.com/rbenv/rbenv.git/': SSL received a record that exceeded the maximum permissible length.

Solution

If you are behind a proxy server make sure that you add your proxy server details in your ~/.bash_profile and source the file afterwards.

So first add the details of your proxy like:

export http_proxy=http://xxx.xxx.xxx.xxx:8080
export https_proxy=https://xxx.xxx.xxx.xxx:8080

And finally source the file before running the installation again:

source ~/.bash_profile

rvm single user installation fails with: curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

Problem

You want to install rvm as a single user in a new linux but when trying to install it with the normal installation instruction:

curl -sSL https://get.rvm.io | bash -s stable --ruby

it fails with the following error:

curl: (35) error:140770FC:SSL routines:SSL23_GET_SERVER_HELLO:unknown protocol

Solution

You are behind a proxy server and you need to setup your environment variables for the server in your .profile file like the following (and make sure you source the file afterwards with . ~/.profile):

export http_proxy=http://xxx.xxx.xxx.xxx:port_no/
export https_proxy=https://xxx.xxx.xxx.xxx:port_no/