概要
- Elixir + Phoenix Tutorial
開発環境
- WSL Ubuntu 20
- Elixir 1.13.3
- Erlang 24.3
- Phoenix v1.6.6
開発環境セットアップ
-
sudo apt install elixir
だと1.9.1になってしまうので、バージョン管理をするパッケージマネージャasdfを導入する、 -
以下のページに倣えばできる
-
プラグインの追加とバージョン管理は以下
-
ErlangはLTSがないらしいので、常に最新版を推奨。
手順
-
公式に従い、導入
-
実行結果
$ mix phx.new tutorial
* creating tutorial/config/config.exs
* creating tutorial/config/dev.exs
* creating tutorial/config/prod.exs
* creating tutorial/config/runtime.exs
* creating tutorial/config/test.exs
* creating tutorial/lib/tutorial/application.ex
* creating tutorial/lib/tutorial.ex
* creating tutorial/lib/tutorial_web/views/error_helpers.ex
* creating tutorial/lib/tutorial_web/views/error_view.ex
* creating tutorial/lib/tutorial_web/endpoint.ex
* creating tutorial/lib/tutorial_web/router.ex
* creating tutorial/lib/tutorial_web/telemetry.ex
* creating tutorial/lib/tutorial_web.ex
* creating tutorial/mix.exs
* creating tutorial/README.md
* creating tutorial/.formatter.exs
* creating tutorial/.gitignore
* creating tutorial/test/support/channel_case.ex
* creating tutorial/test/support/conn_case.ex
* creating tutorial/test/test_helper.exs
* creating tutorial/test/tutorial_web/views/error_view_test.exs
* creating tutorial/lib/tutorial/repo.ex
* creating tutorial/priv/repo/migrations/.formatter.exs
* creating tutorial/priv/repo/seeds.exs
* creating tutorial/test/support/data_case.ex
* creating tutorial/lib/tutorial_web/controllers/page_controller.ex
* creating tutorial/lib/tutorial_web/views/page_view.ex
* creating tutorial/test/tutorial_web/controllers/page_controller_test.exs
* creating tutorial/test/tutorial_web/views/page_view_test.exs
* creating tutorial/assets/vendor/topbar.js
* creating tutorial/lib/tutorial_web/templates/layout/root.html.heex
* creating tutorial/lib/tutorial_web/templates/layout/app.html.heex
* creating tutorial/lib/tutorial_web/templates/layout/live.html.heex
* creating tutorial/lib/tutorial_web/views/layout_view.ex
* creating tutorial/lib/tutorial_web/templates/page/index.html.heex
* creating tutorial/test/tutorial_web/views/layout_view_test.exs
* creating tutorial/lib/tutorial/mailer.ex
* creating tutorial/lib/tutorial_web/gettext.ex
* creating tutorial/priv/gettext/en/LC_MESSAGES/errors.po
* creating tutorial/priv/gettext/errors.pot
* creating tutorial/assets/css/phoenix.css
* creating tutorial/assets/css/app.css
* creating tutorial/assets/js/app.js
* creating tutorial/priv/static/robots.txt
* creating tutorial/priv/static/images/phoenix.png
* creating tutorial/priv/static/favicon.ico
Fetch and install dependencies? [Yn]
* running mix deps.get
We are almost there! The following steps are missing:
$ cd tutorial
$ cd tutorial
$ mix deps.get
Failed to fetch record for 'hexpm/ecto_sql' from registry (using cache instead)
:timeout
Resolving Hex dependencies...
Dependency resolution completed:
Unchanged:
castore 0.1.15
connection 1.1.0
cowboy 2.9.0
cowboy_telemetry 0.4.0
cowlib 2.11.0
db_connection 2.4.2
decimal 2.0.0
ecto 3.7.1
ecto_sql 3.7.2
esbuild 0.4.0
file_system 0.2.10
floki 0.32.0
gettext 0.19.1
html_entities 0.5.2
jason 1.3.0
mime 2.0.2
phoenix 1.6.6
phoenix_ecto 4.4.0
phoenix_html 3.2.0
phoenix_live_dashboard 0.6.5
phoenix_live_reload 1.3.3
phoenix_live_view 0.17.7
phoenix_pubsub 2.0.0
phoenix_view 1.1.2
plug 1.13.4
plug_cowboy 2.5.2
plug_crypto 1.2.2
postgrex 0.16.2
ranch 1.8.0
swoosh 1.6.3
telemetry 1.0.0
telemetry_metrics 0.6.1
telemetry_poller 1.0.0
All dependencies are up to date
$ mix phx.server