Strange behaviour of phx.new and phoenix.new

Hello,

Just getting my feet wet here.

I’m trying to install phoenix app with mix phx.new myapp but strangely it only allows installing on home user directory, while I can install it anywhere using mix phoenix.new myapp.

Both command are pointing to 1.3.0 Phoenix (I’m using mix help), so it should be no problem, but is there any reason it can only install on home user directory for mix phx.new myapp? (I’m afraid on differences I’m not aware-per tutorials I’m journeying), and how I can do it anywhere?

Thanks!

What happens when you try phx.new on a non-home directory? It should work anywhere you have the required permissions to create directories and files.

Yes I have permission to that folder, it is inside home user, like /user/path/to/folder, but still throw key error,

** (KeyError) key :Phoenix not found in: %Phx.New.Project{app: “new_project”, …

Can you gist the whole error? Or is that all you get?

Have you tried reinstalling your archive with

mix archive.uninstall phx_new
mix archive.install https://github.com/phoenixframework/archives/raw/master/phx_new.ez

Yes before I posted and just did it again, the problem still persists.

Here’s the gist if anyone interested.

Getting 404 from that gist link.

I just ran mix phx.new myapp in a non-home directory without issue on linux here (and ran the server to verify), so yeah, definitely need more info. :slight_smile:

My apologies, I was changing my github settings and didn’t check again, now this gist should be working.

/Users/ardhi/Documents/Projects/Programming/Elixir:Phoenix/test

how do you manage to have a colon : (“Elixir:Phoenix”) in the directory name - that should be a big no no on mac (which I assume you are on)… (or do you have forward slash in the directory name and then bash makes it a colon? - again a no no)

try in a directory that does not contain colon or forward slash in its name…

I use forward slash and bash makes it colon, and you know what? Tried it on non colon folders and it worked. :sweat_smile: Seems to be the culprit.

Never again, thank you for pointing it out.

1 Like