【问题标题】:SublimeREPL scala error... Same error, but existing solution does not fix the issueSublimeREPL scala 错误...相同的错误,但现有解决方案无法解决问题
【发布时间】:2013-10-23 18:15:18
【问题描述】:

在运行SublimeREPL: SBT for opened folder 时,我遇到了与The similar question asked before (OSError(2, 'No such file or directory')) 完全相同的问题。

不幸的是,那里提供的解决方案并没有太大帮助。

有人能提供一些线索,说明这里可能还有什么问题吗?

我目前正在运行 Ubuntu 12.04。

我的Main.sublime-menu 配置如下:

[
 {
    "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"
                    }
                } 
            ]}
        ]
    }]
  }
]

另外,scala 和 sbt 系统路径也是这样定义的

λ →  which scala
/usr/bin/scala
λ →  which sbt
/home/helluin/apps/sbt/bin/sbt

【问题讨论】:

    标签: linux scala sublimetext2 sbt sublimerepl


    【解决方案1】:

    你的路径混淆了。 "caption": "scala REPL" 菜单项的命令是 scala,但扩展的 PATH 是 /home/helluin/apps/sbt/bin。 "caption": "SBT for opened folder" 项目的命令是 sbt,而扩展的 PATH 是 /usr/bin。你应该切换它们。

    或者,对于 Scala REPL,创建命令的第一行:

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

    (尽管/usr/bin 应该已经在系统中PATH)。对于sbt REPL,使命令的第一行:

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

    然后您就不必担心扩展该特定环境变量了。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2014-08-19
      • 2010-11-29
      • 1970-01-01
      • 1970-01-01
      • 2020-09-13
      相关资源
      最近更新 更多