HelloWorld example (sbt new sbt/scala-seed.g8) not working

后端 未结 6 1183
北恋
北恋 2020-12-31 07:51

After having installed sbt version 0.13.13 (with brew) on Mac 10.12.2 with scala 2.12.0, I tried the first example on the documentation (as per subject sbt new sbt/sca

相关标签:
6条回答
  • 2020-12-31 08:06

    I had the same issue. Even if you can access http://github.com/sbt/scala-seed.g8.git , your git 9418 port may still be blocked when using sbt or g8. Try running the line below at the command line. It will switch the port that git uses to https:// which is usually not blocked.

    git config --global url."https://".insteadOf git://
    

    It simply adds the following lines to your .gitconfig

    [url "https://"]
        insteadOf = git://
    

    so you can easily remove it if that is not the issue.

    0 讨论(0)
  • 2020-12-31 08:08

    Run it passing as a parameter the git url:

    sbt new https://github.com/sbt/scala-seed.g8
    

    There is no need of changing any git configuration.

    0 讨论(0)
  • 2020-12-31 08:09

    Try using

    sbt new scala/scala-seed.g8
    

    A predefined template in git is required, but when you use one of the sample templates from git, it will create an sbt project with minimum scala build. And to name the project, the predefined templates usually provide you with an option to do so.

    0 讨论(0)
  • 2020-12-31 08:09

    I would like to share my experience:

    I wanted to run sbt new scalatra/scalatra.g8 and was facing error

    "git@github.com:scalatra/scalatra.g8.git: invalid privatekey: [...."

    How fixed it ?

    mkdir temp 
    cd temp
    git clone https://github.com/foundweekends/giter8.g8
    g8 file://giter8.g8
    

    Now it's working and printing

    Creates a Giter8 project template. 
    
    name [My Template Project]:
    

    Hopefully it will save someone's time.

    0 讨论(0)
  • 2020-12-31 08:26

    git clone http://github.com/scala/hello-world.g8.git

    mv ./hello-world.g8/src/main/g8 hello-world

    cd hello-world

    sbt run

    (assuming you have git setup)

    0 讨论(0)
  • 2020-12-31 08:28

    I've experienced similar problem. The way I solved is by installing sdkman:

    curl -s "https://get.sdkman.io" | bash 
    

    Then, instead of my system package manager, I use sdkman to install the scala stuff:

    sdk install java
    sdk install sbt
    sdk install scala
    

    After that, the examples from the documentation works fine in my machine.

    0 讨论(0)
提交回复
热议问题