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

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

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

Solution

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

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

So you can call it like the following from iex:

unhandled &1 outside of a capture

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

Running something like the following in iex:

results in the following error:

Solution

Since the shortcut has been changed you will need to do the following:

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

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

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

Solution

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

Using Elixir with Docker

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

In order to be able to use Elixir with the help of Docker, so that you can run different containers with different versions, and to have a shared code folder, you could follow the steps below:

  • Install docker in your system. Installation instructions for different systems are here
  • Download the elixir image from the Docker Hub:
  • List the images on your host:
  • Start a specific version of the elixir docker container (ie elixir 1.0.3):
  • Use a shared folder with code between the docker container and your host: where the folders after the -v option are /home/user/Prog (host) and /Prog (docker)
  • Use a port forwarding:

Updating Phoenix from 0.3.1 to 0.4.0

Email this to someoneShare on Google+Share on FacebookTweet about this on TwitterShare on LinkedIn

Problem

You would like to upgrade to the latest version of Phoenix 0.4.0 from the previous version of 0.3.1. When you try to update the dependencies and try to start phoenix again (mix phoenix.start) you get the following error:

Solution

After upgrading your Elixir version to the latest (1.0.0-rc1), and updating the path to your elixir installation so that it uses the new one, clear the dependencies from your project:

Change the dependency in your mix.exs file to be as the following:

and then get the dependencies again with:

after that you should be able to start your phoenix project with tne new version.