Last active
July 26, 2018 23:24
-
-
Save zorn/c8899c6a774988e416a132678c545ffd to your computer and use it in GitHub Desktop.
new phx app not getting new template?
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PROBLEM: | |
When I make a new phx app I expect the app template to match what I see in GitHub but it doesn't. | |
Locally in the layout template I get: | |
<li><a href="http://www.phoenixframework.org/docs">Get Started</a></li> | |
But on GitHub it's seems to be: | |
<li><a href="https://hexdocs.pm/phoenix/overview.html">Get Started</a></li> | |
https://github.com/phoenixframework/phoenix/blob/master/installer/templates/phx_web/templates/layout/app.html.eex#L15 | |
This has me concerned I don't have Phoenix installed right but the mix file says 1.3.3. | |
Thoughts? | |
~ Mike | |
Rotom:Desktop zorn$ mix phx.new demo | |
* creating demo/config/config.exs | |
* creating demo/config/dev.exs | |
* creating demo/config/prod.exs | |
* creating demo/config/prod.secret.exs | |
* creating demo/config/test.exs | |
* creating demo/lib/demo/application.ex | |
* creating demo/lib/demo.ex | |
* creating demo/lib/demo_web/channels/user_socket.ex | |
* creating demo/lib/demo_web/views/error_helpers.ex | |
* creating demo/lib/demo_web/views/error_view.ex | |
* creating demo/lib/demo_web/endpoint.ex | |
* creating demo/lib/demo_web/router.ex | |
* creating demo/lib/demo_web.ex | |
* creating demo/mix.exs | |
* creating demo/README.md | |
* creating demo/test/support/channel_case.ex | |
* creating demo/test/support/conn_case.ex | |
* creating demo/test/test_helper.exs | |
* creating demo/test/demo_web/views/error_view_test.exs | |
* creating demo/lib/demo_web/gettext.ex | |
* creating demo/priv/gettext/en/LC_MESSAGES/errors.po | |
* creating demo/priv/gettext/errors.pot | |
* creating demo/lib/demo/repo.ex | |
* creating demo/priv/repo/seeds.exs | |
* creating demo/test/support/data_case.ex | |
* creating demo/lib/demo_web/controllers/page_controller.ex | |
* creating demo/lib/demo_web/templates/layout/app.html.eex | |
* creating demo/lib/demo_web/templates/page/index.html.eex | |
* creating demo/lib/demo_web/views/layout_view.ex | |
* creating demo/lib/demo_web/views/page_view.ex | |
* creating demo/test/demo_web/controllers/page_controller_test.exs | |
* creating demo/test/demo_web/views/layout_view_test.exs | |
* creating demo/test/demo_web/views/page_view_test.exs | |
* creating demo/.gitignore | |
* creating demo/assets/brunch-config.js | |
* creating demo/assets/css/app.css | |
* creating demo/assets/css/phoenix.css | |
* creating demo/assets/js/app.js | |
* creating demo/assets/js/socket.js | |
* creating demo/assets/package.json | |
* creating demo/assets/static/robots.txt | |
* creating demo/assets/static/images/phoenix.png | |
* creating demo/assets/static/favicon.ico | |
Fetch and install dependencies? [Yn] Y | |
* running mix deps.get | |
* running cd assets && npm install && node node_modules/brunch/bin/brunch build | |
We are all set! Go into your application by running: | |
$ cd demo | |
Then configure your database in config/dev.exs and run: | |
$ mix ecto.create | |
Start your Phoenix app with: | |
$ mix phx.server | |
You can also run your app inside IEx (Interactive Elixir) as: | |
$ iex -S mix phx.server | |
Rotom:Desktop zorn$ cd demo/ | |
Rotom:demo zorn$ tail lib/demo | |
demo/ demo.ex demo_web/ demo_web.ex | |
Rotom:demo zorn$ tail lib/demo_web/ | |
channels/ controllers/ endpoint.ex gettext.ex router.ex templates/ views/ | |
Rotom:demo zorn$ tail lib/demo_web/templates/ | |
layout/ page/ | |
Rotom:demo zorn$ tail lib/demo_web/templates/layout/app.html.eex | |
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p> | |
<main role="main"> | |
<%= render @view_module, @view_template, assigns %> | |
</main> | |
</div> <!-- /container --> | |
<script src="<%= static_path(@conn, "/js/app.js") %>"></script> | |
</body> | |
</html> | |
Rotom:demo zorn$ tail --help | |
tail: illegal option -- - | |
usage: tail [-F | -f | -r] [-q] [-b # | -c # | -n #] [file ...] | |
Rotom:demo zorn$ tail -n 100 lib/demo_web/templates/layout/app.html.eex | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<meta name="description" content=""> | |
<meta name="author" content=""> | |
<title>Hello Demo!</title> | |
<link rel="stylesheet" href="<%= static_path(@conn, "/css/app.css") %>"> | |
</head> | |
<body> | |
<div class="container"> | |
<header class="header"> | |
<nav role="navigation"> | |
<ul class="nav nav-pills pull-right"> | |
<li><a href="http://www.phoenixframework.org/docs">Get Started</a></li> | |
</ul> | |
</nav> | |
<span class="logo"></span> | |
</header> | |
<p class="alert alert-info" role="alert"><%= get_flash(@conn, :info) %></p> | |
<p class="alert alert-danger" role="alert"><%= get_flash(@conn, :error) %></p> | |
<main role="main"> | |
<%= render @view_module, @view_template, assigns %> | |
</main> | |
</div> <!-- /container --> | |
<script src="<%= static_path(@conn, "/js/app.js") %>"></script> | |
</body> | |
</html> | |
Rotom:demo zorn$ tail -n 100 mix. | |
mix.exs mix.lock | |
Rotom:demo zorn$ tail -n 100 mix.exs | |
defmodule Demo.Mixfile do | |
use Mix.Project | |
def project do | |
[ | |
app: :demo, | |
version: "0.0.1", | |
elixir: "~> 1.4", | |
elixirc_paths: elixirc_paths(Mix.env), | |
compilers: [:phoenix, :gettext] ++ Mix.compilers, | |
start_permanent: Mix.env == :prod, | |
aliases: aliases(), | |
deps: deps() | |
] | |
end | |
# Configuration for the OTP application. | |
# | |
# Type `mix help compile.app` for more information. | |
def application do | |
[ | |
mod: {Demo.Application, []}, | |
extra_applications: [:logger, :runtime_tools] | |
] | |
end | |
# Specifies which paths to compile per environment. | |
defp elixirc_paths(:test), do: ["lib", "test/support"] | |
defp elixirc_paths(_), do: ["lib"] | |
# Specifies your project dependencies. | |
# | |
# Type `mix help deps` for examples and options. | |
defp deps do | |
[ | |
{:phoenix, "~> 1.3.3"}, | |
{:phoenix_pubsub, "~> 1.0"}, | |
{:phoenix_ecto, "~> 3.2"}, | |
{:postgrex, ">= 0.0.0"}, | |
{:phoenix_html, "~> 2.10"}, | |
{:phoenix_live_reload, "~> 1.0", only: :dev}, | |
{:gettext, "~> 0.11"}, | |
{:cowboy, "~> 1.0"} | |
] | |
end | |
# Aliases are shortcuts or tasks specific to the current project. | |
# For example, to create, migrate and run the seeds file at once: | |
# | |
# $ mix ecto.setup | |
# | |
# See the documentation for `Mix` for more info on aliases. | |
defp aliases do | |
[ | |
"ecto.setup": ["ecto.create", "ecto.migrate", "run priv/repo/seeds.exs"], | |
"ecto.reset": ["ecto.drop", "ecto.setup"], | |
"test": ["ecto.create --quiet", "ecto.migrate", "test"] | |
] | |
end | |
end | |
Rotom:demo zorn$ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment