小编tak*_*ake的帖子

(GETENV XXX) is not a Lisp string or pointer

I'm afraid of asking this kind of basic question.

I want to manage database config by ENV, but I get an error.

This is my code:

(defconfig :common
    `(:databases ((:maindb :mysql
                      :database-name (uiop:getenv "DATABASE_NAME")
                      :host (uiop:getenv "DATABASE_HOST")
                      :port (uiop:getenv "DATABASE_PORT")
                      :username (uiop:getenv "DATABASE_USERNAME")
                      :password (uiop:getenv "DATABASE_PASSWORD")))))
Run Code Online (Sandbox Code Playgroud)

This is sbcl error:

 1(GETENV DATABASE_HOST) is not a Lisp string or pointer.
 2   [Condition of type SIMPLE-ERROR]
 3
 4Restarts:
 5 0: [ABORT] abort thread (#<THREAD "hunchentoot-worker-127.0.0.1:57248" RUNNING {10026777C3}>)
 6
 7Backtrace:
 8  0: ((:METHOD …
Run Code Online (Sandbox Code Playgroud)

common-lisp

1
推荐指数
1
解决办法
91
查看次数

标签 统计

common-lisp ×1