以前は簡単にインストールできてたけど
現在のバージョン(Play 2.3)では地味に困惑する部分があったのでメモ程度に。
まず初めに↓をやってみた。
$ brew install play
Error: No available formula for play
Play 2.3 replaces the play command with activator:
brew install typesafe-activator
You can read more about this change at:
http://www.playframework.com/documentation/2.3.x/Migration23
http://www.playframework.com/documentation/2.3.x/Highlights23
お、怒られたでござる...
どうやら2.3ではtypesafe-activatorというものにリプレースされているらしい。
なので↓で再チャレンジ。
$ brew install typesafe-activator
思ったより時間がかかったのでお茶でも飲んで待ちましょう。
5分以上かかった気がする。
インストール完了したら試しにプロジェクトを作成してみる。
$ activator new PROJ_NAME
といった感じでプロジェクトを作成。
プロジェクトのテンプレートのタイプを聞かれるので使いたいテンプレートを選択。
ここではplay-scalaを選択します。
$ activator new TestProj
Picked up JAVA_TOOL_OPTIONS: -Dfile.encoding=UTF-8
Fetching the latest list of templates...
Browse the list of templates: http://typesafe.com/activator/templates
Choose from these featured templates or enter a template name:
1) minimal-java
2) minimal-scala
3) play-java
4) play-scala
(hit tab to see a list of all templates)
>4
OK, application "TestProj" is being created using the "play-scala" template.
To run "TestProj" from the command line, "cd TestProj" then:
/Users/masahiro/Dev/Web/Play/TestProj/activator run
To run the test for "TestProj" from the command line, "cd TestProj" then:
/Users/masahiro/Dev/Web/Play/TestProj/activator test
To run the Activator UI for "TestProj" from the command line, "cd TestProj" then:
/Users/masahiro/Dev/Web/Play/TestProj/activator ui
プロジェクトが自動生成されるのでとりあえず初期状態でサーバを起動してみます。
$ cd ./TestProj
$ activator run
http://localhost:9000
にアクセスしてみてPlayの初期画面が出たらOKです。