I am trying to set up a development environment on a new Ubuntu machine for a project. It is a project I’ve been working on for a while, and I have successfully set it up on other Macs. I have run through the ‘Up and Running’ Phoenix project on the Ubuntu machine, and it is able to create and connect to a new database, and create new tables, etc. So I think I have ruled out any permissions errors with PostGres.
When I try to run
mix ecto.create I get the following error:
You need to upgrade
postgrex as it do not support your DB version.
Thank you for the response, bumping postgrex fixed the problem. For my future education, how were you able to determine the problem? Is it something you have seen before, or is there something in the error message?
It’s an educated guess, based on the fact that the last function mentioned in the call stack is
Hello @tom-gerken how did you upgrade postgrex I’m facing similar problem
Hi @Muco you can look up the version of postgrex on its GitHub page and edit mix.exs to specify the new version. Then you run
mix deps.update postgrex
Once you’ve checked that it fixed the issue you should commit both mix.exs and mix.lock
Hi @Muco sorry for the dealyed response, it was a holiday weekend for me. As Amarandon suggests you can update the mix.exs file to a compatible version. The other option you have depending on your situation is downgrading the PostGreSQL server version. When I had this problem, the postgrex version for the application was compatible with the server version of Postgresql and the version installed on most developers machines. I had a new developer on my team who downloaded the latest version of Postgres for their local/dev environment and the postgrex version was too old to be compatible. Since postgres allows you to install specific versions, you can install an older version to ensure compatiblity with your application or your can update the postgrex version. Hope this helps!
Thank you @tom-gerken for your reply, I later found the problem was that I’m using ArchLinux based distro called Manjaro and it doesn’t support TCP connection by default, I replaced the hostname field in