6

我有一台 OpenVZ 虚拟化下的 ubuntu 机器。当我运行 fsc test.scala 我得到:

Unable to establish connection to compilation daemon

然后ps aux向我展示了很多看起来像这样的过程

ren      17482  0.0  0.0   4908  1400 pts/0    S    00:29   0:00 /bin/bash --posix /usr/bin/scala -Djava.net.preferIPv4Stack=true scala.tools
ren      17490  0.2  0.5 1246676 24268 pts/0   Sl   00:29   0:00 java -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Stack=true -Xbootc

我已经没有如何让它工作的想法了,版本是Scala code runner version 2.9.2 -- Copyright 2002-2011, LAMP/EPFL. 有任何想法吗?

编辑:

找到 了这个,所以:

  • selinux 没有安装
  • 出口 | grep SCALA 不返回任何内容,但是 scalac 和 scala 编译/运行正常,所以我认为这一步没问题
  • ping localhost - 有效
  • fsc -reset - 同样的错误
  • fsc -verbose >> logfile.log 2>&1 产生这个:
Fast Scala compiler version 2.9.2 -- Copyright 2002-2011, LAMP/EPFL
[Given arguments: -verbose]
[Transformed arguments: -verbose -current-dir /home/ren]
[VM arguments: ]
[Temp directory: /tmp/scala-devel/ren]
[Port number: 36737]
java.net.SocketException: Invalid argument or cannot assign requested address
[Connecting to compilation daemon at port 36737 failed; re-trying...]
No compile server running: starting one with args ''
[Executing command: scala scala.tools.nsc.CompileServer -v]
Starting CompileServer on port 34962
Redirect dir is /tmp/scala-devel/ren/output-redirects
[Port number: 34962]
java.net.SocketException: Invalid argument or cannot assign requested address
[Connecting to compilation daemon at port 34962 failed; re-trying...]
[Port number: 34962]
java.net.SocketException: Invalid argument or cannot assign requested address
[Connecting to compilation daemon at port 34962 failed; re-trying...]
No compile server running: starting one with args '' and so on ...

编辑2:

好吧,像这样启动编译服务器scala scala.tools.nsc.CompileServer -v确实有效!而且似乎 fsc 确实启动了所有这些服务器,但由于某种原因它决定它没有启动。fsc -server localhost:port test.scala作品。现在这已经足够好了。

4

1 回答 1

4

似乎 fsc 用于hostname连接到编译服务器。我的主机名没有响应 ping。将其更改为 localhost/etc/hostname解决了问题。

于 2013-03-21T19:15:20.437 回答