1

I'm on a fresh install of Ubuntu 14.04 LTS. RVM 1.26.11 is installed with Ruby ruby 2.2.0p0. I'm using envconsul to handle environment variables. However, when I do:

envconsul -config=/etc/envconsul.hcl bundle exec rails c

it returns this error:

I, [2015-09-02T00:10:00.420551 #3953] INFO -- : ** [Raven] Raven 0.14.0 ready to catch errors Loading development environment (Rails 4.2.3) Switch to inspect mode.

and just dumps out to the command line. I can run bundle exec rails c on its own, but it fails out because the environment variables aren't set. I tried setting an ~/.irbrc but that doesn't help at all.

I'm really stumped on this one. Anyone have any ideas?

4

1 回答 1

0

尝试以下:

export $(envconsul -consul your_consul_server/agent -prefix your_app_env/ -upcase -pristine -once env)

接着:

ruby -S bundle exec /usr/local/bin/rails c

您显然可以在 *.hcl 文件中包含所有这些 envconsul 选项。

于 2016-06-02T18:26:45.110 回答