Closed nelsonic closed 4 years ago
I've tried uninstalling Elixir and re-installing it. Still get the error. Cannot see where in the code the String.replace/4
is being invoked ... 😞
String.replace/4
is not invoked in our codebase:
using the following search pattern: /Users/n/code/app-mvp-phoenix/, -*/assets/*, -*/deps/*
in SublimeText "find in project", found an instance in config/config.exs
:
I was unable to figure this out. My "solution" was the nuclear option ... 🙄
rm -rf app-mvp-phoenix
git clone git@github.com:dwyl/app-mvp-phoenix.git
cd app-mvp-phoenix
mix deps.get
mix test
....................................................................................................
Finished in 0.8 seconds
100 tests, 0 failures
Randomized with seed 460176
Works.
So frustrating! 😞
@nelsonic Okay so I've been facing the same error on localhost.
If you are using a variable in String.replace() I suggest you use string interpolation.
Example
url = 'postgres://n:n@db:5432/random?'
String.replace("#{url}", "?","b")
In case anyone stumbled upon this and is stumped. This can happen if you have not set your ENCRYPTION_KEYS environment variables because you didn't source
your environment when you are trying to run a mix
task in a new pristine shell environment. Looking at the code from above:
String.replace/4
is not invoked in our codebase:using the following search pattern:
/Users/n/code/app-mvp-phoenix/, -*/assets/*, -*/deps/*
in SublimeText "find in project", found an instance inconfig/config.exs
:
You can see that nil
is being passed as the first argument in the pipeline because System.get_env
returns nil
for an absent environment variable. This is one area where the otherwise awesome Elixir pipe
system obfuscates the source of the actual error.
I haven't changed any code in our project, just added some meta data to the
mix.exs
. The branch is passing Travis-CI: https://github.com/dwyl/app-mvp-phoenix/pull/24 https://travis-ci.com/dwyl/app-mvp-phoenix/builds/138754697On
localhost
when I attempt to run any mix command I see the following error:The stack trace is rather unhelpful ...
Running latest Elixir/Erlang
🤷♂