2012-08-30 36 views
1

我有一個Lift應用程序,我正在推送到Heroku。我已經按照下面的教程來設置我的項目。 - http://blog.heroku.com/archives/2011/10/3/scala/將應用程序推送到heroku - class/object時出錯已經定義

當我做git push heroku master命令和所有的依賴已經被下載了,我得到以下錯誤:

info] Done updating. 
     [info] Compiling 34 Scala sources to /tmp/build_3mu8dl4lcbqoj/target/scala-2.9.1/classes... 
     [error] /tmp/build_3mu8dl4lcbqoj/src/main/scala/code/models/Model.scala:97: CardAttribute is already defined as class CardAttribute 
     [error] class CardAttribute extends MongoRecord[CardAttribute] 
     [error]  ^

該項目編譯好地方,所以我不知道爲什麼它說類/對象已經存在。這是否與heroku上傳項目的方式有關?也許項目緩存導致了這個問題?

+0

所以如果你運行'sbt clean stage',它在本地工作嗎? –

回答

0

這有點晚,但也許這可以幫助別人。

我有同樣的問題,我重構我的代碼,我改變了一個包名,然後我試圖推到Heroku,並且由於重複的對象而失敗。我的錯誤是,我用git add .忽略我的Git版本刪除的文件:

warning: You ran 'git add' with neither '-A (--all)' or '--ignore-removal', whose behaviour will change in Git 2.0 with respect to paths you removed.

Paths like 'app/.DS_Store' that are removed from your working tree are ignored with this version of Git.

  • 'git add --ignore-removal ', which is the current default, ignores paths you removed from your working tree.

  • 'git add --all ' will let you also record the removals.

Run 'git status' to check the paths you removed from your working tree.

解決的辦法是設置的Heroku與heroku config:set SBT_CLEAN=true清潔,然後在git的側git add . -A && git commit -m "message" && git push heroku master

相關問題