While running SublimeREPL: SBT for opened folder, I have the exact same problem as in The similar question asked before (OSError(2, 'No such file or directory')).

Unofrtunately, the solution provided there did not help much.

Would anybody be kind enough to give some clues as to what might still be wrong here?

I'm currently running Ubuntu 12.04.

My Main.sublime-menu config is as follows:

[
 {
    "id": "tools",
    "children":
    [{
        "caption": "SublimeREPL",
        "mnemonic": "r",
        "id": "SublimeREPL",
        "children":
        [
            {"caption": "Scala",
            "id": "Scala",

             "children":[
                {"command": "repl_open",
                 "caption": "scala REPL",
                 "id": "repl_scala",
                 "mnemonic": "s",
                 "args": {
                    "type": "subprocess",
                    "encoding": "utf8",
                    "external_id": "scala",
                    "cmd": {"linux": ["scala"],
                            "osx": ["scala"],
                            "windows": ["scala.bat", "-i"]},
                    "soft_quit": "\nexit\n",
                    "cwd": "$file_path",
                    "cmd_postfix": "\n", 
                    "extend_env": {"osx": {"EMACS": "1", "PATH": "{PATH}:/home/helluin/apps/sbt/bin"},
                                   "linux": {"EMACS": "1", "PATH": "{PATH}:/home/helluin/apps/sbt/bin/"},
                                   "windows": {"EMACS": "1"}},
                    "suppress_echo": false, 
                    "syntax": "Packages/Scala/Scala.tmLanguage"
                    }
                },
                {"command": "repl_open",
                 "caption": "SBT for opened folder",
                 "id": "repl_sbt",
                 "mnemonic": "b",
                 "args": {
                    "type": "subprocess",
                    "encoding": "utf8",
                    "external_id": "scala",
                    "cmd": {"linux": ["sbt"],
                            "osx": ["sbt"],
                            "windows": ["sbt"]},
                    "soft_quit": "\nexit\n",
                    "cwd": "$folder",
                    "cmd_postfix": "\n", 
                    "extend_env": {"osx": {"EMACS": "1", "PATH": "{PATH}:/usr/bin"},
                                   "linux": {"EMACS": "1", "PATH": "{PATH}:/usr/bin"},
                                   "windows": {"EMACS": "1"}},
                    "suppress_echo": false, 
                    "syntax": "Packages/Scala/Scala.tmLanguage"
                    }
                } 
            ]}
        ]
    }]
  }
]

Also, the scala and sbt system paths are defined thusly

λ →  which scala
/usr/bin/scala
λ →  which sbt
/home/helluin/apps/sbt/bin/sbt
有帮助吗?

解决方案

You have your paths mixed up. The "caption": "scala REPL" menu item has scala as its command, but the extended PATH is /home/helluin/apps/sbt/bin. The "caption": "SBT for opened folder" item has sbt as its command, yet the extended PATH is /usr/bin. You should switch them.

Alternatively, for the Scala REPL, make the first line of the command:

"cmd": {"linux": ["/usr/bin/scala"],

(although /usr/bin should already be in the system PATH). For the sbt REPL, make the first line of the command:

"cmd": {"linux": ["/home/helluin/apps/sbt/bin/sbt"],

and then you don't need to worry about extending that particular environment variable.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top