ruby-on-rails-4ansiblerbenv-vars

rbenv-vars - Rails app is not reading them. How do they get loaded?


I am trying to deploy a Ruby 2.2 / Rails 4.2 application from a project I inherited, and rbenv-vars is used (along with rbenv). When I try to start the Puma service, I can tell that the rbenv variables aren't getting loaded because RAILS_ENV is not set, and database.yml doesn't read the environment and uses defaults.

---------- UPDATE June 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:~$ 

What do I have to do to get Ruby to load rbenv-vars to load the environment variables?


Solution

  • Running the command

    > rbenv vars
    

    is the first clue. If you didn't do that, you didn't install rbenv-vars properly.

    I backtracked, and it turns out that I didn't install it properly. I started over, installed it properly, and all of a sudden, everything came together.