I created the key XXXXXX-XXXXXXXXXX in the http://developer.wolframalpha.com/portal/myapps/index.html
with the Application name: rumbl
and then generated the AppID: XXXXXX-XXXXXXXXXX
What I’m doing incorrect?
the value of the WOLFRAM_APP_ID I put just on the config/prod.secret.exs file?
like WOLFRAM_APP_ID= "XXXXXX-XXXXXXXXXX"
and then keep on the config/dev.exs file the code: System.get_env("WOLFRAM_APP_ID") || ?
It’s export then (under the assumption that you use bash or zsh, which both are the default shells in Mac, depending on the version, but as I’m not a Mac user by myself I have no clue when the change happened)
As I said, I’d not hardcode it there for several reasons, but use a .env or .envrc for the project (not comitted into source control) and source it before working with the project.
direnv is a nice tool for such setups. It will automatically “execute” .envrc files when entering a directory, if that directory is “trusted”.
Just for help if someone stopped like me in this part of the book, I’ll share what I do for run correctly.
I create inside the config folder a .env file and then add: export WOLFRAM_APP_ID="XXXXXX-XXXXXXXXXX"
then after I run on terminal: source config/.env
And then I try iex -S mix:
This will only ignore .env from the repositories root. If you want to exclude config/.env, then you have to do /config/.env, assuming that git-root and project root are the same.
Other than that, the flow seems to be correct, though I prefer to have .env(rc) files in the project root for discoverability.
I’m also new to elixir/phoenix and struggled with this. I couldn’t get source to work since I use a windows shell, specifically cmder.
Here is how I finally got it to work. I know this is probably not the way to go in production, but would be helpful to someone who just wants to complete the project on a personal laptop.
create .env file in rumbl_umbrella (the project root)
add this line to the .env file:
export WOLFRAM_APP_ID=“XXX-XXXX”
add /.env to gitignore file
add environment variable to Windows:
Variable name: WOLFRAM_APP_ID
Variable value: path to .env file