snake117

snake117

Currently, I have Phoenix version 1.2.1 installed. If I want to upgrade Phoenix on my Mac to version 1.2.3 or 1.3.0-rc.1, what would be the best to do this? Surprisingly, I couldn’t find much information on this. Also, are there any version management tools for Elixir/Phoenix like there are in Ruby?

Thanks

Showing Posts 1 to 10

rlopzc

rlopzc

Chris McCord made a guide, follow this instructions.

chrismccord

chrismccord

Creator of Phoenix

If you’re asking how to upgrade the phoenix new project installer, you can run mix local.phoenix (now mix local.phx as of RC) and it will grab the latest one and install it so your mix phx.new task will be up to date.

11
Post #2
snake117

snake117 OP

Thank you both for replying.

@chrismccord, that was what I was looking for and it worked like a charm. Way easier than I thought. Thank you!

isethi

isethi

What is the best way to do minor upgrades like upgrading from 1.4.9 to 1.4.16?

kokolegorille

kokolegorille

You need to update your mix.exs file with the latest versions, then…

$ rm -rf _build/ deps/ mix.lock
$ mix deps.get
$ mix compile

In case You need to update javascript too, for live_view, You can…

$ rm -rf assets/node_modules
$ npm install --prefix assets/

Then run your tests to see if there is no breaking change :slight_smile:

seva

seva

Might be worth adding that checking the diff via PhoenixDiff.org between the versions you are upgrading from and to, and syncing the changes to your app could be valuable for codebase maintability.

For exmaple: PhoenixDiff · v1.6.5 to v1.6.11

tmariaz

tmariaz

I’m new to Phoenix and Elixir. I recently got involved in a Phoenix api project which was build ages ago. It has the following versions:

  • Phoenix 1.3.0.
  • Elixir 1.5.1

I follow the instructions provided by the previous developer and tried to run the project. However I can’t install the older version of Elixir and Erlang to test the api. It left me to upgrade the phoenix project to 1.6.15. I followed @chrismccord guide and also followed [phoenixdiff](https://phoenixdiff.org/?source=1.3.0&source_variant=default&target=1.6.15&target_variant=default) and successfully migrated and ran the server.

Upon running the server, I ran into so many problems. If I tried to access the any endpoints, I run into 500 Internal Server Error. Not sure what is exactly going on and unable to figure It out how to debug the code and so. Sorry for being a newbie.

Any help on what maybe wrong and why am I getting the Error code: 500? Any helping hands?

[info] GET /api/me
[debug] Processing with Pxrfd.Web.UserController.me/2
  Parameters: %{}
  Pipelines: [:api]
[info] Sent 500 in 120ms
[error] #PID<0.988.0> running Pxrfd.Web.Endpoint (connection #PID<0.987.0>, stream id 1) terminated
Server: localhost:8000 (http)
Request: GET /api/me
** (exit) an exception was raised:
    ** (FunctionClauseError) no function clause matching in Keyword.get/3
        (elixir 1.14.2) lib/keyword.ex:388: Keyword.get(:default, :key, nil)
        (guardian 2.3.1) lib/guardian/plug.ex:373: Guardian.Plug.fetch_key/2
        (guardian 2.3.1) lib/guardian/plug.ex:141: Guardian.Plug.current_resource/2
        (pxrfd 0.1.0) lib/pxrfd/web/controllers/load_resource.ex:30: Pxrfd.Plug.LoadResource.call/2
        (pxrfd 0.1.0) Pxrfd.Web.Router.api/2
        (pxrfd 0.1.0) lib/pxrfd/web/router.ex:1: Pxrfd.Web.Router.__pipe_through1__/1
        (phoenix 1.6.15) lib/phoenix/router.ex:346: Phoenix.Router.__call__/2
        (pxrfd 0.1.0) lib/plug/error_handler.ex:80: Pxrfd.Web.Router."call (overridable 3)"/2
        (pxrfd 0.1.0) lib/pxrfd/web/router.ex:1: Pxrfd.Web.Router.call/2
        (pxrfd 0.1.0) lib/pxrfd/web/endpoint.ex:1: Pxrfd.Web.Endpoint.plug_builder_call/2
        (pxrfd 0.1.0) lib/pxrfd/web/endpoint.ex:1: Pxrfd.Web.Endpoint."call (overridable 3)"/2
        (pxrfd 0.1.0) lib/pxrfd/web/endpoint.ex:1: Pxrfd.Web.Endpoint.call/2
        (phoenix 1.6.15) lib/phoenix/endpoint/cowboy2_handler.ex:54: 
al2o3cr

al2o3cr

The surface cause: Guardian.Plug.fetch_key was given the atom :default where it expected a Map of options, and crashed.

The root cause appears to be a function call in load_resource.ex that looks something like current_resource(conn, :default); that API changed to current_resource(conn, opts) a long time ago.

silverdr

silverdr

Doesn’t seem to work (anymore?)?

$ mix local.phx
** (Mix) The task "local.phx" could not be found. Did you mean "local.hex"?

What would be the current equivalent?

garrison

garrison

As mentioned in the installation guide:

mix archive.install hex phx_new

It should ask you for permission to overwrite if you already have it installed.

Where Next? Top

Trending in Questions Top

stjefim
Hello! Suppose you are building workflow (order / task / payment) processing system with the following requirements: Each workflow con...
New
jonnycharles
I’m in search of an Elixir library that offers PDF generation capabilities similar to Ruby’s Prawn. While there have been discussions abo...
New
spammy
I’m looking to build a personal workflow to quickly deploy web applications written in elixir/phoenix, for local consumption (ie not on t...
New
dli
Before I dive in myself, did anyone successfully sprinkle Hologram into their existing LiveView app? Looking for hints regarding: Addi...
New
roeland
Kia ora, We have been using elixir-google-api to connect to Google Drive. However, with the updates to Tesla due to CVEs this is now bro...
New
bottlenecked
Hi all, I wanted to ask how the community is dealing with post-release steps. Today we have Ecto migrations, which make sure that the db...
New
rahultumpala
Hello, I have an Elixir backend that implements a custom protocol over TCP. I want to load test the backend and assess the performance o...
New

Other Trending Topics Top

JesseHerrick
Hey, I’m Jesse and I’m the main contributor behind Dexter, a full-featured, lightning-fast Elixir LSP optimized for large codebases. It s...
New
jimsynz
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
mcass19
ExRatatui lets you cook up rich terminal UIs in Elixir, powered by Rust’s ratatui via Rustler NIFs. Build interactive terminal applicatio...
New
Damirados
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge &amp; Solve. They are GUI (Emerge) and State management (S...
New
netoum
Corex is an accessible, unstyled UI component library for Phoenix that integrates Zag.js state machines using Vanilla JavaScript and Live...
New
ausimian
Emily is an Elixir library that runs Nx computations on Apple’s MLX. Install it as the default Nx backend and Nx, defn, Axon, Nx.Serving,...
New

We're in Beta

About us Mission Statement

Options

Thread Display Mode




Thread Preview

Skip Thread Previews