geerlingguy/ansible-role-ruby

User installed gems are not available in PATH

oxyc opened this issue · 0 comments

oxyc commented

The binaries provided from packages installed with ruby_install_gems are not available in the users shell.

vagrant@drupalvm-project:~$ gem list -d | grep 'compass ' -A 4
compass (1.0.3)
    Authors: Chris Eppstein, Scott Davis, Eric M. Suzanne, Brandon
    Mathis, Nico Hagenburger
    Homepage: http://compass-style.org
    Installed at: /home/vagrant/.gem/ruby/1.9.1
vagrant@drupalvm-project:~$ echo $PATH
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/vagrant/.composer/vendor/bin

According the ruby FAQ the path needs to be added to ~/.bashrc

if which ruby >/dev/null && which gem >/dev/null; then
    PATH="$(ruby -rubygems -e 'puts Gem.user_dir')/bin:$PATH"
fi