2012-04-10 20 views
1

我想在這裏按照指示:https://devcenter.heroku.com/articles/clojure-web-applicationLeiningen/Clojure是怪怪的,當我嘗試連接到PostgreSQL數據庫

一切都沒事,直到其中I型

(sql/with-connection (System/getenv "DATABASE_URL") 
    (sql/create-table :testing [:data :text])) 

到Leiningen的步驟REPL。我得到這個錯誤:

org.postgresql.util.PSQLException: Something unusual has occured to cause the driver to fail. Please report this exception. (NO_SOURCE_FILE:0) 

,然後Leiningen甚至不會執行(exit)功能。是什麼賦予了?

請幫忙,謝謝。

+0

什麼是'(系統/ GETENV「DATABASE_URL」)'的價值? – 2012-04-10 14:12:56

+0

「postgresql:/// shouter」 – ZenLikeThat 2012-04-10 15:19:31

+0

我不知道PostgreSQL,但看起來連接字符串缺少主機名。 – 2012-04-10 17:01:55

回答

2

我有同樣的問題。我試圖馬爾科Topolnik的建議,他們沒有對我的工作,但是這一個作用:

export DATABASE_URL=postgresql://localhost/shouter 
+0

太棒了!這工作!我只想完全放棄這個問題:) – ZenLikeThat 2012-04-17 03:25:37

1

漢斯恩格爾是對的。如果您連接到localhost,使用這兩個URL形式之一:

jdbc:postgresql:shouter

jdbc:postgresql://localhost/shouter

,並通過各種手段,檢查official documentation

相關問題