'ensime generate' is not a valid sbt command

2.5k Views Asked by At

I'm trying to use sbt to generate an ensime configuration file as described in this tutorial:

http://jawher.net/2011/01/17/scala-development-environment-emacs-sbt-ensime/

The issue I'm having is that I cannot get sbt to generate a configuration file as the 'ensime generate' command does not appear to be part of the sbt command set.

[output]

[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.

[Steps followed]

cd <project directory> (sbt project root)
sbt 'ensime generate'

[Version info]

sbt 0.7.7
ensime 2.9.2-0.9.8.1
scala 2.9.2

[emacs configuration]

(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)

Any help appreciated (I've checked all the paths so please no comments regarding this)

Cheers,

JLove

3

There are 3 best solutions below

1
On

Have you added the ensime-sbt-cmd plugin to your sbt build? http://aemoncannon.github.com/ensime/index.html#tth_sEc3.1

0
On

I had the same problem. After trying what you did, I solved it with these extra steps:

  1. Install the latest version (as of writing, got 0.12.3 from http://www.scala-sbt.org/release/docs/Getting-Started/Setup.html)
  2. Edit the file project\build.properties and change the sbt.version accordingly (in my case, sbt.version=0.12.3)
  3. Run sbt from the project root.

Since you already modified the plugins file, this should install the ensime command. If you want to run it from the command line, remember to quote the command (sbt "ensime generate").

0
On

it seems you need to quote the command on the shell i.e.:

$ sbt "ensime generate"

HTH