我正在尝试使用 sbt 生成一个 ensime 配置文件,如本教程中所述:
http://jawher.net/2011/01/17/scala-development-environment-emacs-sbt-ensime/
我遇到的问题是我无法让 sbt 生成配置文件,因为"ensime 生成"命令似乎不是 sbt 命令集的一部分。
[输出]
[info] Building project ScalaTest 1.0 against Scala 2.9.2
[info] using sbt.DefaultProject with sbt 0.7.7 and Scala 2.7.7
[error] No method named 'ensime' exists.
[info] Execute 'help' for a list of commands or 'actions' for a list of available project actions and methods.
[info]
[info] Total time: 0 s, completed 26-Jan-2013 12:53:48
[info]
[info] Total session time: 0 s, completed 26-Jan-2013 12:53:48
[error] Error during build.
[遵循的步骤]
cd <project directory> (sbt project root)
sbt 'ensime generate'
[版本信息]
sbt 0.7.7
ensime 2.9.2-0.9.8.1
scala 2.9.2
[emacs 配置]
(add-to-list 'load-path "~/.emacs.d/scala-emacs")
(require 'scala-mode-auto)
(add-hook 'scala-mode-hook
'(lambda ()
(scala-mode-feature-electric-mode)
))
(require 'scala-mode)
(add-to-list 'auto-mode-alist '("\.scala$" . scala-mode))
(add-to-list 'load-path "~/.emacs.d/ensime/elisp/")
(require 'ensime)
(add-hook 'scala-mode-hook 'ensime-scala-mode-hook)
(push "/media/xxx/Development/Runtimes/scala-2.9.2/bin/" exec-path)
(push "/media/xxx/Development/Tools/sbt/" exec-path)
感谢任何帮助(我已经检查了所有路径,所以请不要对此发表评论)
干杯
捷威
ensime-sbt-cmd插件添加到您的sbt构建中? http://aemoncannon.github.com/ensime/index.html#tth_sEc3.1
您需要引用shell上的命令,即:
$ sbt "ensime generate"
呵呵
我遇到了同样的问题。尝试了您所做的操作后,我通过以下额外步骤解决了它:
- 安装最新版本(截至撰写本文时,从 http://www.scala-sbt.org/release/docs/Getting-Started/Setup.html 获得0.12.3)
- 编辑文件
projectbuild.properties
并相应地更改sbt.version
(在我的情况下,sbt.version=0.12.3
) - 从项目根目录运行 sbt。
由于您已经修改了插件文件,因此应该安装 ensime 命令。如果要从命令行运行它,请记住引用命令(sbt "ensime generate"
)。