我正在尝试从我继承的项目中部署 Ruby 2.2 / Rails 4.2 应用程序,并且使用了 rbenv-vars(以及 rbenv)。当我尝试启动 Puma 服务时,我可以看出 rbenv 变量没有被加载,因为 RAILS_ENV 没有设置,并且 database.yml 没有读取环境并使用默认值。
---------- 更新 6 月 6 日 --------------
deployer@host0:~$ which rbenv
/opt/rbenv/bin/rbenv
deployer@host0:~$ rbenv vars
rbenv: no such command `vars'
deployer@host0:~$ echo $PATH
/opt/rbenv/shims:/opt/rbenv/bin:/opt/rbenv/plugins/ruby-build/bin:/opt/rbenv/plugins/rbenv_vars/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/opt/vagrant_ruby/bin
deployer@host0:~$ rbenv versions
system
* 2.2.4 (set by /opt/rbenv/version)
deployer@host0:~$ ruby -v
ruby 2.2.4p230 (2015-12-16 revision 53155) [x86_64-linux]
deployer@host0:~$ gem list
*** LOCAL GEMS ***
bigdecimal (1.2.6)
bundler (1.12.5)
io-console (0.4.3)
json (1.8.1)
minitest (5.4.3)
power_assert (0.2.2)
psych (2.0.8)
rake (10.4.2)
rdoc (4.2.0)
test-unit (3.0.8)
deployer@host0:~$ which gem
/opt/rbenv/shims/gem
deployer@host0:~$
我该怎么做才能让 Ruby 加载 rbenv-vars 来加载环境变量?