sbt executando mas não pode ver na porta 9000 centos 6.5

1

Depois de baixar o sbt.rpm (versão 0.13.1) e instalar com o yum, ele parece estar funcionando com sucesso, mas quando eu vou para link não foi encontrado.

Aqui estão alguns resultados após o comando sbt

   ent/0.13.1/jars/test-agent.jar ...
   [SUCCESSFUL ] org.scala-sbt#test-agent;0.13.1!test-agent.jar (1248ms)
   downloading http://repo1.maven.org/maven2/org/scala-sbt/test-        interface/1.0/test-interface-1.0.jar ...
   [SUCCESSFUL ] org.scala-sbt#test-interface;1.0!test-interface.jar    (864ms)
downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-    sbt/apply-macro/0.13.1/jars/apply-macro.jar ...
    [SUCCESSFUL ] org.scala-sbt#apply-macro;0.13.1!apply-macro.jar     (1946ms)
:: retrieving :: org.scala-sbt#boot-app
   confs: [default]
   43 artifacts copied, 0 already retrieved (12646kB/207ms)
   Getting Scala 2.10.3 (for sbt)...
    downloading http://repo1.maven.org/maven2/org/scala-lang/jline/2.10.3/jline-     2.10.3.jar ...
    [SUCCESSFUL ] org.scala-lang#jline;2.10.3!jline.jar (1180ms)
downloading     http://repo1.maven.org/maven2/org/fusesource/jansi/jansi/1.4/jansi-1.4.jar ...
    [SUCCESSFUL ] org.fusesource.jansi#jansi;1.4!jansi.jar (1316ms)
:: retrieving :: org.scala-sbt#boot-scala
    confs: [default]
5 artifacts copied, 0 already retrieved (24447kB/136ms)
[info] Set current project to local (in build file:/usr/local/)
  > 

Em seguida, comande run e recebo o seguinte:

java.lang.RuntimeException: No main class detected.
    at scala.sys.package$.error(package.scala:27)

Estou tentando fazer isso funcionar para que eu possa jogar um jogo de gamão na linguagem scala.

Ficando um pouco mais longe, coloquei a pasta scala wbillingsley / play-backgammon em / usr / local / src / main / scala e agora, quando executo o comando, recebo o seguinte:

    Loading /usr/share/sbt/bin/sbt-launch-lib.bash
 [info] Set current project to local (in build file:/usr/local/)
 > run
 [info] Compiling 8 Scala sources to /usr/local/target/scala-2.10/classes...
 [error] /usr/local/src/main/scala/play-    backgammon/app/controllers/Application.scala:3: not found: object play
 [error] import play.api._
 [error]        ^
[error] /usr/local/src/main/scala/play-   backgammon/app/controllers/Application.scala:5: not found: object play
[error] import play.api.mvc._
[error]        ^
[error] /usr/local/src/main/scala/play-   backgammon/app/controllers/Application.scala:8: not found: object play
 [error] import play.api.libs.json._
 [error]        ^
    
por cea 10.03.2014 / 10:02

1 resposta

2

Aqui estão os passos que usei para que isso funcione. Vou observar que usei apenas as duas URLs que você forneceu:

Etapa 1 - instale o SBT

Eu executei os dois comandos a seguir para baixar e instalar o SBT.

$ wget http://repo.scala-sbt.org/scalasbt/sbt-native-packages/org/scala-sbt/sbt/0.13.1/sbt.rpm 
$ sudo yum localinstall sbt.rpm 

Etapa 2 - Reporte GIT do clone

Em seguida, executei este comando para clonar uma cópia do repositório do GitHub para o jogo de gamão.

$ git clone https://github.com/wbillingsley/play-backgammon.git

Etapa 3 - Compilando o gamão

Provavelmente, o passo crítico que você está omitindo é que você precisa alterar os diretórios para o jogo de gamão, antes de executar o SBT.

$ cd play-backgammon

Agora, dentro do diretório do projeto, execute sbt .

$ sbt
Loading /usr/share/sbt/bin/sbt-launch-lib.bash
Getting org.scala-sbt sbt 0.12.1 ...
downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/sbt/0.12.1/jars/sbt.jar ...
    [SUCCESSFUL ] org.scala-sbt#sbt;0.12.1!sbt.jar (697ms)
downloading http://repo.typesafe.com/typesafe/ivy-releases/org.scala-sbt/main/0.12.1/jars/main.jar ...
    [SUCCESSFUL ] org.scala-sbt#main;0.12.1!main.jar (2133ms)
...
Getting Scala 2.9.2 (for sbt)...
downloading http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.9.2/scala-compiler-2.9.2.jar ...
    [SUCCESSFUL ] org.scala-lang#scala-compiler;2.9.2!scala-compiler.jar (6836ms)
downloading http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.9.2/scala-library-2.9.2.jar ...
    [SUCCESSFUL ] org.scala-lang#scala-library;2.9.2!scala-library.jar (4865ms)
downloading http://repo1.maven.org/maven2/org/scala-lang/jline/2.9.2/jline-2.9.2.jar ...
    [SUCCESSFUL ] org.scala-lang#jline;2.9.2!jline.jar (388ms)
:: retrieving :: org.scala-sbt#boot-scala
    confs: [default]
    4 artifacts copied, 0 already retrieved (20090kB/71ms)
[info] Loading project definition from /home/saml/programming_projects/scala/play-backgammon/project
[info] Set current project to play-backgammon (in build file:/home/saml/programming_projects/scala/play-backgammon/)
[play-backgammon] $ 

Etapa # 4 - executando o jogo

[play-backgammon] $ run

Getting Scala 2.10.0-RC1 ...
downloading http://repo1.maven.org/maven2/org/scala-lang/scala-compiler/2.10.0-RC1/scala-compiler-2.10.0-RC1.jar ...
    [SUCCESSFUL ] org.scala-lang#scala-compiler;2.10.0-RC1!scala-compiler.jar (9087ms)
downloading http://repo1.maven.org/maven2/org/scala-lang/scala-library/2.10.0-RC1/scala-library-2.10.0-RC1.jar ...
    [SUCCESSFUL ] org.scala-lang#scala-library;2.10.0-RC1!scala-library.jar (3653ms)
downloading http://repo1.maven.org/maven2/org/scala-lang/scala-reflect/2.10.0-RC1/scala-reflect-2.10.0-RC1.jar ...
    [SUCCESSFUL ] org.scala-lang#scala-reflect;2.10.0-RC1!scala-reflect.jar (2091ms)
downloading http://repo1.maven.org/maven2/org/scala-lang/jline/2.10.0-RC1/jline-2.10.0-RC1.jar ...
    [SUCCESSFUL ] org.scala-lang#jline;2.10.0-RC1!jline.jar (479ms)
:: retrieving :: org.scala-sbt#boot-scala
    confs: [default]
...
...
[info] downloading http://repo1.maven.org/maven2/org/w3c/css/sac/1.3/sac-1.3.jar ...
[info]  [SUCCESSFUL ] org.w3c.css#sac;1.3!sac.jar (372ms)
[info] downloading http://repo1.maven.org/maven2/org/jboss/netty/netty/3.2.7.Final/netty-3.2.7.Final.jar ...
[info]  [SUCCESSFUL ] org.jboss.netty#netty;3.2.7.Final!netty.jar(bundle) (656ms)
[info] downloading http://repo1.maven.org/maven2/org/easytesting/fest-util/1.1.6/fest-util-1.1.6.jar ...
[info]  [SUCCESSFUL ] org.easytesting#fest-util;1.1.6!fest-util.jar (331ms)
[info] Done updating.
--- (Running the application from SBT, auto-reloading is enabled) ---

[info] play - Listening for HTTP on /0:0:0:0:0:0:0:0:9000

(Server started, use Ctrl+D to stop and go back to the console...)

Etapa 5 - JOGAR!

Quando chegar a este ponto, você poderá acessar seu navegador e acessar o jogo por meio do URL http://localhost:9000 .

    
por 11.03.2014 / 02:22

Tags