2013-10-15 40 views
0

在運行SublimeREPL: SBT for opened folder時,我遇到了與The similar question asked beforeOSError(2, 'No such file or directory'))完全相同的問題。SublimeREPL scala錯誤...同樣的錯誤,但現有的解決方案不能解決問題

不幸的是,在那裏提供的解決方案沒有多大幫助。

有人會提供一些線索,告訴我們這裏可能還有什麼問題嗎?

我正在使用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" 
        } 
       } 
      ]} 
     ] 
    }] 
    } 
] 

此外,scalasbt系統路徑正是如此定義

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

回答

0

你有你的路徑混淆。 "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"], 

,然後你不必擔心延長特定的環境變量。

+0

固定。非常感謝! – helluin