Tuesday, June 23, 2015

rbenv: version `ruby' is not installed on production


1. env | grep PATH

Check that rbenv shims is in the path:

PATH=/usr/local/rbenv/shims:/usr/local/rbenv/shims:/usr/local/rbenv/bin:/usr/local/rbenv/shims:/usr/local/rbenv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games
NODE_PATH=/usr/lib/nodejs:/usr/lib/node_modules:/usr/share/javascript

2.

See `rbenv help ' for information on a specific command.
For full documentation, see: https://github.com/sstephenson/rbenv#readme
deploy@localhost:~/apps/carmel_production/current$ rbenv versions
rbenv: version `ruby' is not installed
  2.2.2
deploy@localhost:~/apps/carmel_production/current$ rbenv 2.2.2
rbenv: no such command `2.2.2'
deploy@localhost:~/apps/carmel_production/current$ rbenv local 2.2.2
deploy@localhost:~/apps/carmel_production/current$ rbenv versions
* 2.2.2 (set by /home/deploy/apps/carmel_production/current/.ruby-version)
deploy@localhost:~/apps/carmel_production/current$ ruby -v
ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-linux]
deploy@localhost:~/apps/carmel_production/current$ bundle exec unicorn -D -c /home/deploy/apps/carmel_production/shared/config/unicorn.rb -E production