简体   繁体   English

逆时针设置环境变量

[英]Set environment variables in Counterclockwise

I am trying to set production and dev profiles in Eclipse in order to deploy my compojure/ring app on Heroku. 我试图在Eclipse中设置生产和开发配置文件,以便将我的compojure / ring应用程序部署在Heroku上。 However, the Counterclockwise plug-in doesn't load up environment variables from the profile. 但是,逆时针插件不会从配置文件中加载环境变量。 I have added the variables in the environment tab and have restarted the REPL but the variables are still not available. 我在环境选项卡中添加了变量,并重新启动了REPL,但是变量仍然不可用。 This is how I added them: environment variables . 这就是我添加它们的方式: 环境变量

I have also tried adding the variables to profiles.clj but to no avail: 我也尝试将变量添加到profiles.clj,但无济于事:

`:profiles
    {:production
      {:ring
        {:open-browser? false, 
         :stacktraces? false, 
         :auto-reload? false}
       :env {:port 3000
           :db-url "//localhost/login"
           :db-user "test"
           :db-pass "test"
           :galleries-path "test"}}
       :dev
        {:dependencies [[ring-mock "0.1.5"]
                        [ring/ring-devel "1.2.0"]]
        :env {:port 3000
              :db-url "//localhost/gallery"
              :db-user "test"
              :db-pass "testProd"
              :galleries-path "galleries"}}}`

When you use environ, it automatically coerces "DB_URL" into the more idiomatic :db-url . 使用环境时,它将自动将"DB_URL"转换为更惯用的:db-url Looking at environ's coercion code, it doesn't seem like it should matter, but I would try uppercasing and underscoring all of the environment variables you have set in the Environment tab. 查看环境的强制代码,这似乎并不重要,但是我会尝试大写并强调您在“环境”选项卡中设置的所有环境变量。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM