2011-03-22 43 views
4

我剛裝上通過的MacPorts OSX斯卡拉致命錯誤:未找到對象斯卡拉

sudo的港口安裝scala28

我創建了一個叫做簡單的腳本test.scala

println("hello world") 

當我運行它通過

斯卡拉test.scala

我得到以下錯誤:

scala test.scala 
error: fatal error: object scala not found. 
one error found 

有什麼想法?

**更新** 從REPL運行產生正確的結果,但仍無法使用 「斯卡拉」 直接

Welcome to Scala version 2.8.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_24). 
Type in expressions to have them evaluated. 
Type :help for more information. 

scala> :load ./test.scala 
Loading ./test.scala... 
hi there sir 

scala> 

**更新FINAL **

當我做了PS -ef | grep scala 我有一對scala編譯服務器在運行,當我關閉這些服務器並重新運行我的腳本時,所有工作都重新開始。一定是處於不好的狀態。

+0

這聽起來像是類路徑問題。當您嘗試使用'scalac'編譯某些內容時會發生什麼? – pedrofurla 2011-03-23 11:57:12

+0

好吧,爲什麼不接受答案?它爲我工作很好... – 2012-06-13 18:46:25

回答

7

似乎是FSC處於不良狀態,重新啓動FSC編譯器

+0

是的,這也幫助了我,謝謝 – 2012-06-13 18:45:10

+5

你如何做到這一點? – 2012-08-08 17:01:07