ScalaInstall (for Mac OS X & Homebrew )play framework$ brew install typesafe-activator
create new project$ activator new (projectname) `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-akka-java-seed 2) minimal-akka-scala-seed 3) minimal-java 4) minimal-scala 5) play-java 6) play-scala (hit tab to see a list of all templates) > 6 OK, application "(projectname)" is being created using the "play-scala" template. (projectname)のところで指定したディレクトリが作成されるのでcdする。そしておもむろに立ち上げてみる。 $ activator run http://localhost:9000/ Hello Worldhttp://qiita.com/kukita/items/6326f1439abec013a479 ここの手順 1-9(Applicaton.scala編集)を行い、ブラウザをリロードすると再コンパイルが始まって"Hello, World."という文字列が表示される。 DBとの接続とりあえずbuild.sbtをいじる。
※ケツカンマに気をつけろ!!!!! 参考資料PlayFramework - (60分クッキング) Play Framework (Scala)+MySQLでREST APIサーバーを作る - QiitaPlay 2.4 Hands on導入部分はわかりやすかった 感想
[error] [/Users/karia/source/karia/scala-play-sample/build.sbt]:16: ')' expected but string literal found. Project loading failed: (r)etry, (q)uit, (l)ast, or (i)gnore? q
[info] Compiling 7 Scala sources and 1 Java source to /Users/karia/source/karia/scala-play-sample/target/scala-2.11/classes... [info] 'compiler-interface' not yet compiled for Scala 2.11.6. Compiling... [info] Compilation completed in 14.1 s Warning: node.js detection failed, sbt will use the Rhino based Trireme JavaScript engine instead to run JavaScript assets compilation, which in some cases may be orders of magnitude slower than using node.js. [info] - play.api.Play - Application started (Dev)
Play 2.4.4 scala 2.11.6 |