“在sbt执行期间出错:未指定或未检测到Scala版本"来自Homebrew的SBT [英] "Error during sbt execution: No Scala version specified or detected" with SBT from Homebrew

查看:189
本文介绍了“在sbt执行期间出错:未指定或未检测到Scala版本"来自Homebrew的SBT的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了Scala 2.10.3 和SBT 0.13.1 .当我按照 SBT文档中的世界您好执行SBT时,我得到了以下错误消息:

I have installed Scala 2.10.3 and SBT 0.13.1. When I execute SBT following Hello, World from the SBT documentation I get the following error message:

执行sbt时出错:未指定或未检测到Scala版本"

"Error during sbt execution: No Scala version specified or detected"

我试图用scalaVersion添加build.sbt文件,但是错误不断出现.

I've tried to add a build.sbt file with the scalaVersion but the error keeps showing up.

请告知.

我刚刚将sbt降级到0.12.3,它可以工作...所以0.13.X怎么了?

I've just downgraded sbt to 0.12.3 and it works ... so what's wrong with 0.13.X ?

推荐答案

升级0.13.*版本不是问题.它的存储库缓存多数民众赞成在引起问题.对于缓存中的sbt jar,有可能坏了/没有常春藤(只有通过jar仓库下载的jar).

Its not an issue with the upgrade of 0.13.* version. Its the repository cache thats causing the issue. There are possibilities where you have broken / no ivys (when only the jar is downloaded through maven repo) for the sbt jars in your cache.

升级后,删除常春藤仓库缓存(或重命名文件夹)并删除.sbt/boot文件夹(删除该文件夹将使您从头开始)

Once upgraded remove your ivy repo cache (or rename the folder) and remove the .sbt/boot folder (removing this will enable to start from the scratch)

编辑您的./sbt/repositories文件,并提供对ivy存储库的首选项.如果您正在使用同时包含常春藤和Maven样式工件的代理存储库,则按如下所示添加它

Edit your ./sbt/repositories file and provide preference to the ivy repositories. If you are using proxy repositories which includes both ivy and maven style artifacts, the add it as below

[repositories]

local

maven-local

maven-central-ivy: http://<repository url>, [organization]/[module]/(scala_[scalaVersion]/)(sbt_[sbtVersion]/)[revision]/[type]s/[artifact](-[classifier]).[ext]

maven-central: http://<repository url>

这将尤其使(org.scala-sbt/sbt/*)与Ivys xml一起下载,从中获取版本/修订版和依赖项.如果仅从"maven-central"下载了jar,则将发生错误.

This will enable especially (org.scala-sbt/sbt/*) to be download with the Ivys xml from where the version / revision and dependencies are picked up for the builds. If only the jar is downloaded from "maven-central", then the error occurs.

这篇关于“在sbt执行期间出错:未指定或未检测到Scala版本"来自Homebrew的SBT的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆