November 8, 2017

db-spec null is missing a required parameter

➜  tinapay git:(master) ✗ lein run migrate
2017-11-08 09:31:29,097 [main] DEBUG org.jboss.logging - Logging Provider: org.jboss.logging.Slf4jLoggerProvider
2017-11-08 09:31:29,720 [main] INFO  migratus.core - Starting migrations
2017-11-08 09:31:29,734 [main] ERROR migratus.database - Error creating DB connection for
java.lang.IllegalArgumentException: db-spec null is missing a required parameter
	at clojure.java.jdbc$get_connection.invokeStatic(jdbc.clj:379) ~[na:na]

Need to set the DATABASE_URL environment variable before running the migrate command:

export DATABASE_URL="jdbc:h2:./guestbook.db"

This environment variable is set in the profiles.clj file. The file was missing as I had deleted the directory and cloned in from my git repository. By default, profiles.clj is not added into the versioning system.

Tags: clojure luminus